Re: [opensuse] nmbd does not start at boot in openSUSE 12.2-SOLVED
2013. augusztus 24. 12:48 napon Andrey Borzenkov <arvidjaar@gmail.com> írta:
What should I do if I wanted to start nmb through the script and not by the boot.local?
Just like in the sysvinit case, you need to explicitly configure it to be started during boot. Think of /etc/systemd/system as of /etc/init.d. Having script there is not enough to make script run on startup; you also need to link it in proper "run-level". If service file has correct [Install] section, you can do it using "systemctl enable nmbd.service" (similar to chkconfig nmbd on). If service file does not have [Install] section, you can manually link it into /etc/systemd/system/default.target.wants (or multi-user.target.wants) so that service is started wherever you boot. Again, this is exactly the same with sysvinit scripts lacking meta information for chkconfig - you manually link into respective /etc/init.d/rc?.d directory.
Andrey, sorry for the late answer. Thanks for your explanation. I looked at the service files and they have [Install] section. I applied systemctl enable: # systemctl enable nmb.service ln -s '/etc/systemd/system/nmb.service' '/etc/systemd/system/multi-user.target.wants/nmb.service' # systemctl enable smb.service ln -s '/etc/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service' # systemctl enable winbind.service ln -s '/etc/systemd/system/winbind.service' '/etc/systemd/system/multi-user.target.wants/winbind.service' But the service are still not started. # systemctl status nmb.service nmb.service - Samba NMB Daemon Loaded: loaded (/etc/systemd/system/nmb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:46:41 +0200; 13min ago CGroup: name=systemd:/system/nmb.service # systemctl status smb.service smb.service - Samba SMB Daemon Loaded: loaded (/etc/systemd/system/smb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:43:19 +0200; 18min ago CGroup: name=systemd:/system/smb.service Aug 30 13:43:18 linux smbd[3765]: [2013/08/30 13:43:18.971776, 0] lib/pidfile.c:118(pidfile_create) # I can't start them manually either: # systemctl start nmb.service Job failed. See system journal and 'systemctl status' for details. # # systemctl start smb.service Job failed. See system journal and 'systemctl status' for details # Here are the contents of service files: # cat /etc/systemd/system/nmb.service [Unit] Description=Samba NMB Daemon After=syslog.target network.target [Service] Type=forking PIDFile=/run/nmbd.pid EnvironmentFile=-/etc/sysconfig/samba ExecStart=/usr/sbin/nmbd $NMBDOPTIONS [Install] WantedBy=multi-user.target # # # cat /etc/systemd/system/smb.service [Unit] Description=Samba SMB Daemon After=syslog.target network.target nmb.service winbind.service [Service] Type=forking PIDFile=/run/smbd.pid LimitNOFILE=16384 EnvironmentFile=-/etc/sysconfig/samba ExecStart=/usr/sbin/smbd $SMBDOPTIONS [Install] WantedBy=multi-user.target Should I edit the service files? Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Fri, 30 Aug 2013 12:14:17 +0200 Istvan Gabor <suseuser04@lajt.hu> пишет:
2013. augusztus 24. 12:48 napon Andrey Borzenkov <arvidjaar@gmail.com> írta:
What should I do if I wanted to start nmb through the script and not by the boot.local?
Just like in the sysvinit case, you need to explicitly configure it to be started during boot. Think of /etc/systemd/system as of /etc/init.d. Having script there is not enough to make script run on startup; you also need to link it in proper "run-level". If service file has correct [Install] section, you can do it using "systemctl enable nmbd.service" (similar to chkconfig nmbd on). If service file does not have [Install] section, you can manually link it into /etc/systemd/system/default.target.wants (or multi-user.target.wants) so that service is started wherever you boot. Again, this is exactly the same with sysvinit scripts lacking meta information for chkconfig - you manually link into respective /etc/init.d/rc?.d directory.
Andrey, sorry for the late answer. Thanks for your explanation.
I looked at the service files and they have [Install] section. I applied systemctl enable:
# systemctl enable nmb.service ln -s '/etc/systemd/system/nmb.service' '/etc/systemd/system/multi-user.target.wants/nmb.service'
# systemctl enable smb.service ln -s '/etc/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'
# systemctl enable winbind.service ln -s '/etc/systemd/system/winbind.service' '/etc/systemd/system/multi-user.target.wants/winbind.service'
But the service are still not started.
# systemctl status nmb.service nmb.service - Samba NMB Daemon Loaded: loaded (/etc/systemd/system/nmb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:46:41 +0200; 13min ago CGroup: name=systemd:/system/nmb.service
# systemctl status smb.service smb.service - Samba SMB Daemon Loaded: loaded (/etc/systemd/system/smb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:43:19 +0200; 18min ago CGroup: name=systemd:/system/smb.service
That's pretty weird. Result: resources usually mean some low level operation (like memory allocation or process creation) failed.
Aug 30 13:43:18 linux smbd[3765]: [2013/08/30 13:43:18.971776, 0] lib/pidfile.c:118(pidfile_create) #
I can't start them manually either:
# systemctl start nmb.service Job failed. See system journal and 'systemctl status' for details. # # systemctl start smb.service Job failed. See system journal and 'systemctl status' for details #
Here are the contents of service files:
Where have you got them from? I just installed samba on 12.3 and it does not ship with any unit definition. It is using /etc/init.d scripts and is started normally, both nmbd and smbd. I doubt very much 12.2 did anything different.
# cat /etc/systemd/system/nmb.service [Unit] Description=Samba NMB Daemon After=syslog.target network.target
[Service] Type=forking PIDFile=/run/nmbd.pid
How to you know this is the correct file? Default on openSUSE is /var/run/samba if nothing is specified (which is the same as /run/samba). This alone would prevent systemd from detecting service startup.
EnvironmentFile=-/etc/sysconfig/samba
This file does not exist after clean installation of samba on 12.3
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
So NMBDOPTIONS is empty
[Install] WantedBy=multi-user.target # # # cat /etc/systemd/system/smb.service [Unit] Description=Samba SMB Daemon After=syslog.target network.target nmb.service winbind.service
[Service] Type=forking PIDFile=/run/smbd.pid LimitNOFILE=16384 EnvironmentFile=-/etc/sysconfig/samba ExecStart=/usr/sbin/smbd $SMBDOPTIONS
[Install] WantedBy=multi-user.target
Should I edit the service files?
Unless you are learning systemd, I'd say you should use package that comes with your version of openSUSE and do not try to "fix" it. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
2013. szeptember 1. 8:01 napon Andrey Borzenkov <arvidjaar@gmail.com> írta:
I looked at the service files and they have [Install] section. I applied systemctl enable:
# systemctl enable nmb.service ln -s '/etc/systemd/system/nmb.service' '/etc/systemd/system/multi-user.target.wants/nmb.service'
# systemctl enable smb.service ln -s '/etc/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'
# systemctl enable winbind.service ln -s '/etc/systemd/system/winbind.service' '/etc/systemd/system/multi-user.target.wants/winbind.service'
But the service are still not started.
# systemctl status nmb.service nmb.service - Samba NMB Daemon Loaded: loaded (/etc/systemd/system/nmb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:46:41 +0200; 13min ago CGroup: name=systemd:/system/nmb.service
# systemctl status smb.service smb.service - Samba SMB Daemon Loaded: loaded (/etc/systemd/system/smb.service; enabled) Active: failed (Result: resources) since Fri, 30 Aug 2013 13:43:19 +0200; 18min ago CGroup: name=systemd:/system/smb.service
That's pretty weird. Result: resources usually mean some low level operation (like memory allocation or process creation) failed.
Aug 30 13:43:18 linux smbd[3765]: [2013/08/30 13:43:18.971776, 0] lib/pidfile.c:118(pidfile_create) #
I can't start them manually either:
# systemctl start nmb.service Job failed. See system journal and 'systemctl status' for details. # # systemctl start smb.service Job failed. See system journal and 'systemctl status' for details #
Here are the contents of service files:
Where have you got them from? I just installed samba on 12.3 and it does not ship with any unit definition. It is using /etc/init.d scripts and is started normally, both nmbd and smbd. I doubt very much 12.2 did anything different.
Andrey, thanks again. Let me summarize why I tried to apply these service files. As you write above, samba uses /etc/init.d scripts. The expected behavior is to start both nmb and smb services. Unfortunately the setup/package in openSUSE 12.1 and 12.2 is buggy and nmb does not start if the network setup is not fast enough. That occurs in my case. nmb start does not wait for the network to be set up, but without running network nmb dies. (I would not be surprised if this occurred in 12.3 too.) I could solve the issue by adding nmb to /etc/boot.local as lynn suggested. But you explained nicely how the service files work, and I thought I gave a try. I obtained the service files from the source samba tar.gz file embedded in openSUSE samba src.rpm. As these service files are not made for openSUSE I am not surprised they are not working.
# cat /etc/systemd/system/nmb.service [Unit] Description=Samba NMB Daemon After=syslog.target network.target
[Service] Type=forking PIDFile=/run/nmbd.pid
How to you know this is the correct file? Default on openSUSE is /var/run/samba if nothing is specified (which is the same as /run/samba). This alone would prevent systemd from detecting service startup.
Understood. I did not know if that file was the correct one. I just tested it and it seems it wasn't.
EnvironmentFile=-/etc/sysconfig/samba
This file does not exist after clean installation of samba on 12.3
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
So NMBDOPTIONS is empty
[Install] WantedBy=multi-user.target # # # cat /etc/systemd/system/smb.service [Unit] Description=Samba SMB Daemon After=syslog.target network.target nmb.service winbind.service
[Service] Type=forking PIDFile=/run/smbd.pid LimitNOFILE=16384 EnvironmentFile=-/etc/sysconfig/samba ExecStart=/usr/sbin/smbd $SMBDOPTIONS
[Install] WantedBy=multi-user.target
Should I edit the service files?
Unless you are learning systemd, I'd say you should use package that comes with your version of openSUSE and do not try to "fix" it.
Yes, I absolutely agree. I don't want to learn systemd at the moment. I let my system go with /etc/boot.local change. By the way I would be the happiest if I should not fix this package and if it worked without any fix. Thanks, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrey Borzenkov
-
Istvan Gabor