Help needed to with tevent and samba_runcmd

Stefan (metze) Metzmacher metze at samba.org
Tue Sep 4 03:09:12 MDT 2012


Hi Andrew,

> 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
> tevent_req);
> +       struct task_server *task = tevent_req_data(req, struct
> task_server);
> 
> fails because we don't have the right req/subreq pattern.  

It should be

+       struct task_server *task =
+               tevent_req_callback_data(subreq,
+               struct task_server);

> 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.

See
https://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=b023560577175bfa769e30da8445dc208ab28326
https://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=e883bfc389335cfe798585e40c2dbe2d2b879f9f

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120904/1201d70b/attachment.pgp>


More information about the samba-technical mailing list