On Tue, Jul 12, 2016 at 10:00 AM, mathias dufresne <infractory at gmail.com> wrote:> Chris, can you check into your unit file what kind of type is used?Mine use Type=forking, I had some issues with Type=notify but it's been some time so I can't remember what they were. Although one is that a "systemctl start samba" command did not return a prompt, had to Ctrl-C out.
Certainly the behaviour of couple Samba / Systemd has changed at one moment: I did not write by myself these unit files so the presence of "type=forking" was wrote by someone else and certainly it was working at that moment with that kind of type in unit file. Could you simply try to modify type=forking to type=notify and test again? Perhaps your old has disappeared (they do sometimes, not often enough)... 2016-07-12 16:09 GMT+02:00 Sonic <sonicsmith at gmail.com>:> On Tue, Jul 12, 2016 at 10:00 AM, mathias dufresne <infractory at gmail.com> > wrote: > > Chris, can you check into your unit file what kind of type is used? > > Mine use Type=forking, I had some issues with Type=notify but it's > been some time so I can't remember what they were. Although one is > that a "systemctl start samba" command did not return a prompt, had to > Ctrl-C out. >
On Tue, Jul 12, 2016 at 10:13 AM, mathias dufresne <infractory at gmail.com> wrote:> Could you simply try to modify type=forking to type=notify and test again? > Perhaps your old has disappeared (they do sometimes, not often enough)...Seems to work for starting smbd and nmbd (although Type=forking has been running flawlessly for many months) on my Gentoo system. In my Debian LXC (Debian host) running a Samba AD, besides having to Ctrl-C to get a prompt back samba dies in short order. Runs fine with Type=forking. Chris
On Tue, Jul 12, 2016 at 10:09 AM, Sonic <sonicsmith at gmail.com> wrote:> Mine use Type=forking, I had some issues with Type=notifyFurther testing seems to verify that either type works for starting nmbd and smbd, but I need forking for starting samba (AD) as samba dies shortly after starting it with notify.>From some systemd info:"If set to forking, it is expected that the process configured with ExecStart= will call fork() as part of its start-up. The parent process is expected to exit when start-up is complete and all communication channels are set up. The child continues to run as the main daemon process. This is the behavior of traditional UNIX daemons." I'm guessing that indeed the samba binary calls fork() as part of its start-up. Can this be verified? And how about the smbd and nmbd binaries, do they call fork() during stat-up? Chris
On 12/07/16 19:53, Sonic wrote:> On Tue, Jul 12, 2016 at 10:09 AM, Sonic <sonicsmith at gmail.com> wrote: >> Mine use Type=forking, I had some issues with Type=notify > Further testing seems to verify that either type works for starting > nmbd and smbd, but I need forking for starting samba (AD) as samba > dies shortly after starting it with notify. > > From some systemd info: > "If set to forking, it is expected that the process configured with > ExecStart= will call fork() as part of its start-up. The parent > process is expected to exit when start-up is complete and all > communication channels are set up. The child continues to run as the > main daemon process. This is the behavior of traditional UNIX > daemons." > I'm guessing that indeed the samba binary calls fork() as part of its > start-up. Can this be verified? And how about the smbd and nmbd > binaries, do they call fork() during stat-up? > > Chris >Are starting the 'smbd', 'nmbd' and samba binaries together ? Rowland
Just backported 4.4.5 from debian sid to jessie. samba.service is masked there. If running as an fileserver the services are started via smbd.service,nmbd.service, winbind.service. There is an samba-ad-dc script which is masked by default. To get the ad-dc up and running with systemd one has to unmask samba-ad-dc.service and mask smbd.service,nmbd.service, winbind.service. This is the samba-ad-dc.service script: [Unit] Description=Samba AD Daemon Documentation=man:samba(8) man:samba(7) man:smb.conf(5) After=network.target [Service] Type=notify NotifyAccess=all PIDFile=/run/samba.pid LimitNOFILE=16384 EnvironmentFile=-/etc/default/samba ExecStart=/usr/sbin/samba $SAMBAOPTIONS ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target Am 12.07.2016 um 20:53 schrieb Sonic:> On Tue, Jul 12, 2016 at 10:09 AM, Sonic <sonicsmith at gmail.com> wrote: >> Mine use Type=forking, I had some issues with Type=notify > Further testing seems to verify that either type works for starting > nmbd and smbd, but I need forking for starting samba (AD) as samba > dies shortly after starting it with notify. > > From some systemd info: > "If set to forking, it is expected that the process configured with > ExecStart= will call fork() as part of its start-up. The parent > process is expected to exit when start-up is complete and all > communication channels are set up. The child continues to run as the > main daemon process. This is the behavior of traditional UNIX > daemons." > I'm guessing that indeed the samba binary calls fork() as part of its > start-up. Can this be verified? And how about the smbd and nmbd > binaries, do they call fork() during stat-up? > > Chris >
On Tue, 12 Jul 2016 14:53:39 -0400 Sonic <sonicsmith at gmail.com> wrote:> On Tue, Jul 12, 2016 at 10:09 AM, Sonic <sonicsmith at gmail.com> wrote: > > Mine use Type=forking, I had some issues with Type=notify > > Further testing seems to verify that either type works for starting > nmbd and smbd, but I need forking for starting samba (AD) as samba > dies shortly after starting it with notify. > > From some systemd info: > "If set to forking, it is expected that the process configured with > ExecStart= will call fork() as part of its start-up. The parent > process is expected to exit when start-up is complete and all > communication channels are set up. The child continues to run as the > main daemon process. This is the behavior of traditional UNIX > daemons." > I'm guessing that indeed the samba binary calls fork() as part of its > start-up. Can this be verified? And how about the smbd and nmbd > binaries, do they call fork() during stat-up? > > ChrisHi Chris, I don't use systemd, but what I recommend to my systemd friends when they run into this sort of problem is to start up daemontools-encore from systemd, and start up Samba (using the -F for foreground) from daemontools-encore. That way you get the benefit of systemd (there must be SOME benefit or you'd be using Runit, OpenRC or sysvinit), yet you have the easily examined startup and supervision of daemontools-encore. Everything I just said about daemontools-encore can also be said of both Runit and S6. HTH, SteveT Steve Litt July 2016 featured book: Troubleshooting Techniques of the Successful Technologist http://www.troubleshooters.com/techniques