file_server: Run task_server_terminate when smbd exists
authorAndrew Bartlett <abartlet@samba.org>
Tue, 4 Sep 2012 09:06:15 +0000 (11:06 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 4 Sep 2012 10:16:48 +0000 (20:16 +1000)
This will help us shut down when smbd cannot bind to ports or perform
some other critical startup operation.

Based on a patch by Stefan Metzmacher <metze@samba.org>

Andrew Bartlett

file_server/file_server.c

index 7c8517e..091432f 100644 (file)
@@ -78,6 +78,9 @@ static const char *generate_smb_conf(struct task_server *task)
  */
 static void file_server_smbd_done(struct tevent_req *subreq)
 {
+       struct task_server *task =
+               tevent_req_callback_data(subreq,
+               struct task_server);
        int sys_errno;
        int ret;
 
@@ -87,6 +90,7 @@ static void file_server_smbd_done(struct tevent_req *subreq)
        } else {
                DEBUG(0,("file_server smbd daemon exited normally\n"));
        }
+       task_server_terminate(task, "smbd child process exited", true);
 }