smbd as a daemon

Andreas Schneider asn at samba.org
Mon Mar 24 10:00:10 MDT 2014


Hello,

we have an issue with systemd and smbd (maybe also winbind and nmbd). systemd 
assumes that if the daemon starts up and returns with the exit code SUCCESS 
that it is ready and working. In a systemd service file normally you specify 
the PID file which is used to check if a service is running:

systemctl status smb.service


The problem is that when smbd starts we check if we want to become a daemon. 
If yes, then we fork and the parent exits with 0. Then we create some 
directories and create the pid file. So between the exit and the creation of 
the pid file we have a race condition.

The correct thing would be to wait in the parent util the child is done with 
the init and then send a signal it can successfully exit.


The questions what is suggested way to do this inside of smbd?


Please help!


Thanks,


	-- andreas



-- 
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org
www.samba.org



More information about the samba-technical mailing list