[Samba] daemontools supervise and smbd

Gabriele Dr Gallacci gabriele at gallacci.com
Sun Jun 2 23:49:03 GMT 2002


Hello,
 I'm trying to run smbd with djb daemontools' supervise.
 Here's the way I followed:


# 2/6/2002
# problem running samba-2.2.4 and supervise

problem:        run smbd with supervise
subproblem 1:   smbd & nnmbd with -D option deteach from tty, so
		supervise cannot control them;
  solution 1:   we can patch smb/server.c (foreground patch) to prevent
		deteach, but a second problem arise:


------------------------------------------------------------------------------------
        if (is_daemon && !foreground) {
                DEBUG( 3, ( "Becoming a daemon.\n" ) );
  /* comment this to prevent from deteaching from tty
   *            become_daemon();
   *
   */
        }
------------------------------------------------------------------------------------


subproblem 2:   when you kill smbd with "svc -d smbd", smbd process kill
		also supervise
  solution 2:   the problem is addressed in
	http://www.geocrawler.com/archives/3/503/2001/12/0/7433256/ ;
                we can use the -i swith (interactive mode)

subproblem 3:   using -i we need to use inetd or tcpserver; but -i +
		tcpserver is not possible
                since tcpserver doesnot handle udp packets; we have to
		use smbd in daemon mode
  solution 3:   use -i and -D togheter

subproblem 4:   smbd doesnot fork because the -i is used;
  solution 4:   patch:
------------------------------------------------------------------------------------
    276                                 continue;
    277                         }
    278
    279 /* remove here to fork even in -i mode
    280  *                 if (smbd_server_fd() != -1 && interactive)
    281  *                              return True;
    282  */
    283                   if (smbd_server_fd() != -1 && sys_fork()==0) {
    284                                 /* Child code ... */
------------------------------------------------------------------------------------

subproblem 5:   where is output ? perhaps in interactive mode output has
		different redirection?
                but most of all, am I on the correct way to solve the
		problem ?



Waiting for some hints,
with regards


-- 

Gabriele Dr Gallacci
GALLACCI communications

email: 	 gabriele at gallacci.com
web:  	 http://www.gallacci.com
phone:   tel +39 583 32 55 50 - fax +39 583 32 55 50
address: Via delle Gavine 798 - 55056 S.Macario - LUCCA - Italy





More information about the samba mailing list