Cannot Start Samba after openSUSE 13.1 upgrade

Cannot get samba to start on server after upgrade to openSUSE 13.1. At real loss with the lack of information in the logs. I will try and start out with some output I am getting back and my smb.conf. the hostname will be obfuscated as ‘HOSTNAME’ so ignore that. Samba logs in /var/logs/samba have the same output for the most part and nothing more useful.

When trying to start since it fails at startup


HOSTNAME:/home/admin # systemctl start smb.service && systemctl start nmb.service
Job for smb.service failed. See 'systemctl status smb.service' and 'journalctl -xn' for details.
HOSTNAME:/home/admin # systemctl status smb.service
smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled)
   Active: failed (Result: resources) since Thu 2013-12-19 22:21:33 MST; 29s ago
  Process: 11601 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 9507 (code=exited, status=1/FAILURE)


Dec 19 22:21:33 HOSTNAME systemd[1]: Starting Samba SMB Daemon...
Dec 19 22:21:33 HOSTNAME smbd[11601]: [2013/12/19 22:21:33.884975,  0] ../source3/smbd/server.c:1278(main)
Dec 19 22:21:33 HOSTNAME smbd[11601]: standard input is not a socket, assuming -D option
Dec 19 22:21:33 HOSTNAME smbd[11602]: [2013/12/19 22:21:33.886266,  0] ../lib/util/pidfile.c:117(pidfile_create)
Dec 19 22:21:33 HOSTNAME smbd[11602]: ERROR: can't open /var/run/samba/smbd.pid: Error was No such file or directory
Dec 19 22:21:33 HOSTNAME systemd[1]: PID file /run/samba/smbd.pid not readable (yet?) after start.
Dec 19 22:21:33 HOSTNAME systemd[1]: smb.service never wrote its PID file. Failing.
Dec 19 22:21:33 HOSTNAME systemd[1]: Failed to start Samba SMB Daemon.
Dec 19 22:21:33 HOSTNAME systemd[1]: Unit smb.service entered failed state.


smb.conf


[global]
        workgroup = WORKGROUP
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = No
        domain logons = No
        domain master = No
        netbios name = HOSTNAME
        security = domain
        wins support = No
        password server = *
        wins server =
[somesite]
        writeable = yes
        path = /srv/www/htdocs/somesite
        inherit acls = Yes
        read only = No
        follow symlinks = Yes
        username = admin
[commonfiles]
        public = yes
        path = /commonfiles
        inherit acls = Yes

Thanks in advance

Maybe Apparmor is blocking it?
Try to turn it off:

sudo rcapparmor stop

Does Samba start then?

There was a problem with Samba’s Apparmor profile included in 13.1 IIRC. But that should be fixed already.
Did you install all updates?

I have the same problem…
Don’t see samba and nmb at all in the runlevel.
I think there was an update yesterday, think this it has caused.

|[TABLE=“class: table”]
|
[TR]
[TD]
|

[/TD]
[TD=“colspan: 4”]

[/TD]
[/TR]
[/TABLE]

Did you try:

systemctl start smb.service nmb.service

:expressionless:

How do you know you have the same problem? The OP doesn’t mention anything about it not being visible in the runlevel editor… :wink:

Well, don’t use the Runlevel editor. It’s broken with systemd (even was in 12.3 already).
Use the new YaST->System->Services Manager instead.

I think there was an update yesterday, think this it has caused.

Right, I just noticed it doesn’t start here either anymore.
Anyway, quitting Apparmor as I suggested fixes the problem for me.

sudo /sbin/rcapparmor stop

You can completely disable it in YaST->System->Services Manager or with:

sudo systemctl disable apparmor.service

Apparently that update caused a problem with apparmor (again).

PS: If you don’t want to disable Apparmor, just run this to update the Apparmor profile:

sudo logprof

Choose “Allow” for smb and nmb and save your changes, then Samba should work again.

About the service manager in yast, that my fault…
I have missed that…

:’(
Sorry my English is not very good.

Found this:

apparmor.service - LSB: AppArmor initialization Loaded: loaded (/etc/init.d/boot.apparmor) Active: active (exited) since Fri 2013-12-20 13:34:54 CET; 25min ago Process: 580 ExecStart=/etc/init.d/boot.apparmor start (code=exited, status=0/SUCCESS)
Dec 20 13:34:54 linux-gfqx systemd[1]: Starting LSB: AppArmor initialization… Dec 20 13:34:54 linux-gfqx boot.apparmor[580]: Starting AppArmor AppArmor parser error for /etc/apparmor.d/usr.sbin.smbd in /etc/apparmor.d/local/usr.sbin.smbd-shares at line 19: syntax error, unexpected TOK_ID, expecting TOK_MODE Dec 20 13:34:54 linux-gfqx boot.apparmor[580]: /etc/apparmor.d/usr.sbin.smbd failed to load…failed Dec 20 13:34:54 linux-gfqx boot.apparmor[580]: …done Dec 20 13:34:54 linux-gfqx systemd[1]: Started LSB: AppArmor initialization.

I disable Apparmor and stop it.

Thanks all.

Looks like it was as simple as apparmor, thanks for the tip ;), and allowing it via logprof was just what I needed to do. Same note about the runlevel as well but it is in system manager which I had already figured out. Also, had install updates along with dvd during the actual install and double checked afterwards.

I was able to solve with the following for anyone who is referencing my OP, not sure where the highjack has gone though.

logprof

You will need to run with superuser rights.

Did you notice we have a dutch openSUSE Launch Party, 27th of december ? Info in the dutch subforums.

another way to fix this problem is go into

/var/run and make a folder called samba, then start samba up. The only down side about this is if you restart your computer it wil delete the samba folder.

Well, it looks the same thing here, too.

The small applet advised me to update some 49 packets and I choosed to proceed. It then complained about some dependencies, so I think I canceled. I thought it would be nice though, to apply the updates by yast. Yast came up with fewer packets for update, but anyway, I continued.

Well, the rest is known.

This is my /var/log/messages first time of the error’s appearance:

2013-12-20T17:32:40.755691+02:00 linux-5kek smbd[975]: [2013/12/20 17:32:40.755597, 0] …/source3/smbd/server.c:1278(main)
2013-12-20T17:32:40.756977+02:00 linux-5kek kernel: 30.327456] type=1400 audit(1387553560.755:31): apparmor=“DENIED” operation=“mkdir” parent=975 profile="/usr/sbin/smbd" name="/var/run/samba/" pid=2374 comm=“smbd” requested_mask=“c” denied_mask=“c” fsuid=0 ouid=0
2013-12-20T17:32:40.756680+02:00 linux-5kek smbd[975]: standard input is not a socket, assuming -D option
2013-12-20T17:32:40.756939+02:00 linux-5kek smbd[2374]: [2013/12/20 17:32:40.756685, 0] …/lib/util/pidfile.c:117(pidfile_create)
2013-12-20T17:32:40.757296+02:00 linux-5kek smbd[2374]: ERROR: can’t open /var/run/samba/smbd.pid: Error was No such file or directory
2013-12-20T17:32:40.757934+02:00 linux-5kek systemd[1]: PID file /run/samba/smbd.pid not readable (yet?) after start.
2013-12-20T17:32:40.781152+02:00 linux-5kek systemd[1]: smb.service never wrote its PID file. Failing.
2013-12-20T17:32:40.782142+02:00 linux-5kek systemd[1]: Failed to start Samba SMB Daemon.
2013-12-20T17:32:40.782458+02:00 linux-5kek systemd[1]: Unit smb.service entered failed state.

################################################################################

And this is the Servise smb/nmb full info, from YaST->System->Services Manager:

smb.service - Samba SMB Daemon
Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled)
Active: failed (Result: resources) since Sat 2013-12-21 16:29:44 EET; 39min ago
Process: 834 ExecStart=/usr/sbin/smbd $SMBDOPTIONS (code=exited, status=0/SUCCESS)

Dec 21 16:29:43 linux-5kek systemd[1]: Starting Samba SMB Daemon…
Dec 21 16:29:44 linux-5kek smbd[834]: [2013/12/21 16:29:44.236967, 0] …/source3/smbd/server.c:1278(main)
Dec 21 16:29:44 linux-5kek smbd[834]: standard input is not a socket, assuming -D option
Dec 21 16:29:44 linux-5kek smbd[912]: [2013/12/21 16:29:44.238709, 0] …/lib/util/pidfile.c:117(pidfile_create)
Dec 21 16:29:44 linux-5kek smbd[912]: ERROR: can’t open /var/run/samba/smbd.pid: Error was No such file or directory
Dec 21 16:29:44 linux-5kek systemd[1]: PID file /run/samba/smbd.pid not readable (yet?) after start.
Dec 21 16:29:44 linux-5kek systemd[1]: smb.service never wrote its PID file. Failing.
Dec 21 16:29:44 linux-5kek systemd[1]: Failed to start Samba SMB Daemon.
Dec 21 16:29:44 linux-5kek systemd[1]: Unit smb.service entered failed state.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

nmb.service - Samba NMB Daemon
Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled)
Active: failed (Result: resources) since Sat 2013-12-21 16:29:43 EET; 56min ago
Process: 772 ExecStart=/usr/sbin/nmbd $NMBDOPTIONS (code=exited, status=0/SUCCESS)

Dec 21 16:29:43 linux-5kek systemd[1]: Starting Samba NMB Daemon…
Dec 21 16:29:43 linux-5kek systemd[1]: PID file /run/samba/nmbd.pid not readable (yet?) after start.
Dec 21 16:29:43 linux-5kek systemd[1]: nmb.service never wrote its PID file. Failing.
Dec 21 16:29:43 linux-5kek systemd[1]: Failed to start Samba NMB Daemon.
Dec 21 16:29:43 linux-5kek systemd[1]: Unit nmb.service entered failed state.

################################################################################

I created a folder named samba on /var/run and
on 17:37:35 the following commands are executed:
/sbin/rcapparmor stop
systemctl start smb.service nmb.service

This is from /var/log/samba/log.nmbd:


[2013/12/21 16:29:43, 0] …/source3/nmbd/nmbd.c:902(main)
nmbd version 4.1.3-3.12.1-3127-SUSE-oS13.1-x86_64 started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2013/12/21 16:29:43, 0] …/source3/nmbd/nmbd.c:941(main)
standard input is not a socket, assuming -D option
[2013/12/21 16:29:43, 0] …/lib/util/util.c:216(directory_create_or_exist)
mkdir failed on directory /var/run/samba: Permission denied
[2013/12/21 16:29:43, 0] …/source3/nmbd/nmbd.c:977(main)
Failed to create directory /var/run/samba for pid files - Permission denied
[2013/12/21 17:31:25, 0] …/source3/nmbd/nmbd.c:902(main)
nmbd version 4.1.3-3.12.1-3127-SUSE-oS13.1-x86_64 started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2013/12/21 17:31:25, 0] …/source3/nmbd/nmbd.c:941(main)
standard input is not a socket, assuming -D option
[2013/12/21 17:31:25, 0] …/lib/util/util.c:216(directory_create_or_exist)
mkdir failed on directory /var/run/samba: Permission denied
[2013/12/21 17:31:25, 0] …/source3/nmbd/nmbd.c:977(main)
Failed to create directory /var/run/samba for pid files - Permission denied
[2013/12/21 17:37:12, 0] …/source3/nmbd/nmbd.c:902(main)
nmbd version 4.1.3-3.12.1-3127-SUSE-oS13.1-x86_64 started.
Copyright Andrew Tridgell and the Samba Team 1992-2013
[2013/12/21 17:37:12, 0] …/source3/nmbd/nmbd.c:941(main)
standard input is not a socket, assuming -D option
[2013/12/21 17:37:12, 0] …/source3/nmbd/nmbd_logonnames.c:162(add_logon_names)
add_domain_logon_names:
Attempting to become logon server for workgroup WORKGROUP on subnet 192.168.10.177
[2013/12/21 17:37:12, 0] …/source3/nmbd/nmbd_become_dmb.c:294(become_domain_master_browser_bcast)
become_domain_master_browser_bcast:
Attempting to become domain master browser on workgroup WORKGROUP on subnet 192.168.10.177
[2013/12/21 17:37:12, 0] …/source3/nmbd/nmbd_become_dmb.c:307(become_domain_master_browser_bcast)
become_domain_master_browser_bcast: querying subnet 192.168.10.177 for domain master browser on workgroup WORKGROUP
[2013/12/21 17:37:16, 0] …/source3/nmbd/nmbd_logonnames.c:123(become_logon_server_success)
become_logon_server_success: Samba is now a logon server for workgroup WORKGROUP on subnet 192.168.10.177
[2013/12/21 17:37:20, 0] …/source3/nmbd/nmbd_become_dmb.c:112(become_domain_master_stage2)


Samba server LINUX-5XEC is now a domain master browser for workgroup WORKGROUP on subnet 192.168.10.177


[2013/12/21 17:37:35, 0] …/source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)


Samba name server LINUX-5XEC is now a local master browser for workgroup WORKGROUP on subnet 192.168.10.177


################################################################################

I can disable the apparmor for smb/nmb from YaST->Security and users->AppArmor settings, so that it stays disabled during restarts.
And the question here is:
→ How will I know that a fix update has been applied, so I can start rcapparmor normally?

PS
I’m really sorry for the long post, I do it only to contribute/help you guys solve it.
Thank you in advance,
Jim

Have a look at https://forums.opensuse.org/english/get-technical-help-here/network-internet/493647-cannot-start-samba-after-opensuse-13-1-upgrade.html#post2610077

Run “logprof” to update the apparmor profile for smbd and nmbd and you can enable apparmor like before.

O.K., maybe I’m being dense here (probably) but running “logprof” just gives me this:
Reading log entries from /var/log/messages.Updating AppArmor profiles in /etc/apparmor.d.
After a reboot, I still have to recreate the /var/run/samba directory for samba to run.
???

Hm. logprof should list the blocked accesses and ask you whether you want to allow, deny, and so on.

What does this give?

sudo grep DENIED /var/log/messages

And please the output of this, when you did not create /var/run/samba, so it fails to start:

systemctl status smb.service

Dec 24 12:14:25 linux-0cgw systemd[1]: Starting Samba SMB Daemon…
Dec 24 12:14:25 linux-0cgw smbd[750]: [2013/12/24 12:14:25.258007, 0] …/source3/smbd/server.c:1278(main)
Dec 24 12:14:25 linux-0cgw smbd[750]: standard input is not a socket, assuming -D option
Dec 24 12:14:25 linux-0cgw smbd[756]: [2013/12/24 12:14:25.259160, 0] …/lib/util/pidfile.c:117(pidfile_create)
Dec 24 12:14:25 linux-0cgw systemd[1]: PID file /run/samba/smbd.pid not readable (yet?) after start.
Dec 24 12:14:25 linux-0cgw systemd[1]: smb.service never wrote its PID file. Failing.
Dec 24 12:14:25 linux-0cgw systemd[1]: Failed to start Samba SMB Daemon.
Dec 24 12:14:25 linux-0cgw systemd[1]: Unit smb.service entered failed state.

So after a reboot, samba is still failing to start. A ran “logprof” again after a reboot and BEFORE i recreated the samba directory in /var/run and just get this:

linux-0cgw:/home/thomas # logprof
Reading log entries from /var/log/messages.
Updating AppArmor profiles in /etc/apparmor.d.

So, I’m not sure what else to do other than recreate the samba directory after each reboot.

Thanks

Strange. If Apparmor is blocking, it should write something to /var/log/messages…
It works fine if you stop Apparmor, right?

Well, AFAIK Apparmor may be logging to /var/log/audit/audit.log as well. Do you have that file?

Problem is that samba is no longer listed in the runlevel services either
I can concur with the other comments here, that something is flucked up

However. To start samba
As su -

systemctl start smb.service

And all is OK if you have followed the other advices to disable it in aparmor

But it still doesn’t show as a running service in the runlevel section

You mean YaST->Runlevel Editor?
Don’t use that anymore, it doesn’t work 100% correctly since the switch to systemd.

Use the new Services Manager instead. Samba shows fine there on my system even after the update.

That it doesn’t show in the Runlevel Editor may be caused by this bug though:
https://bugzilla.novell.com/show_bug.cgi?id=856759