Help needed to with tevent and samba_runcmd
abartlet at samba.org
Tue Sep 4 02:33:21 MDT 2012
In file_server/file_server.c I'm trying to get the variable 'task' from
s3fs_task_init() to file_server_smbd_done()
What I want to do is call
task_server_terminate(task, "Failed to startup s3fs smb task", true);
when the smbd task exits. The idea is that if smbd fails after the
exec(), such as failing to bind to ports, we will shut down all of
'samba' and not leave it half-working.
However, I suspect that the runcmd code isn't built quite per the
standard tevent pattern - calling:
+ struct tevent_req *req = tevent_req_callback_data(subreq, struct
+ struct task_server *task = tevent_req_data(req, struct
fails because we don't have the right req/subreq pattern.
However, I'm a little at sea on tevent, so if someone has the time to
help me sort this out, it will help our users with a more reliable full
failure of 'samba' when the ports are already in use.
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
More information about the samba-technical