Just updated TW now SMB daemon fails to start

Just updated today and now when I boot up SMB fails to start as a daemon. I can start both smbd and nmbd with the /i flag to run in foreground from a console but I am unable to start them via systemctl or from a console as a daemon, keeps saying


Becoming a daemon.
exit_daemon: STATUS=daemon failed to start: Failed to create session, error code 1

This was not happening prior to my update. Seems that the problem is in the daemon mode as it runs normally in interactive mode. Samba is showing as 4.8.0+git.19.f53c6c0aa6f-1.1

Anyone any ideas please?

Stuart

I’d appreciate it if a moderator could correct my typo in the title which should of course say SMB as I noticed it too late to change it.

Stuart

I see the same after zypper dup’ing today…

“systemctl start smb nmb” keeps failing just like during boot, when I try manually as root from e.g. konsole.

I am able to start smbd, nmbd and winbindd with options “-D -F” manually, though…

Edgar

I have the same issue.

server1:/var/log/samba # systemctl start smb nmb
Job for nmb.service failed because the control process exited with error code.
See "systemctl status nmb.service" and "journalctl -xe" for details.
Job for smb.service failed because the control process exited with error code.
See "systemctl status smb.service" and "journalctl -xe" for details.
server1:/var/log/samba # journalctl -xe         
-- Subject: Unit smb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit smb.service has begun starting up.
dub 08 12:27:06 server1 nmbd[2996]: [2018/04/08 12:27:06.622500,  0] ../lib/util/become_daemon.c:124(exit_daemon)
dub 08 12:27:06 server1 systemd[1]: Starting Samba NMB Daemon...
-- Subject: Unit nmb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nmb.service has begun starting up.
dub 08 12:27:06 server1 nmbd[2996]:   exit_daemon: STATUS=daemon failed to start: Failed to create session, error code 1
dub 08 12:27:06 server1 systemd[1]: nmb.service: Main process exited, code=exited, status=1/FAILURE
dub 08 12:27:06 server1 smbd[2998]: [2018/04/08 12:27:06.856898,  0] ../lib/util/become_daemon.c:124(exit_daemon)
dub 08 12:27:06 server1 systemd[1]: nmb.service: Failed with result 'exit-code'.
dub 08 12:27:06 server1 smbd[2998]:   exit_daemon: STATUS=daemon failed to start: Failed to create session, error code 1
dub 08 12:27:06 server1 systemd[1]: Failed to start Samba NMB Daemon.
-- Subject: Unit nmb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit nmb.service has failed.
-- 
-- The result is RESULT.
dub 08 12:27:06 server1 systemd[1]: smb.service: Main process exited, code=exited, status=1/FAILURE
dub 08 12:27:06 server1 systemd[1]: smb.service: Failed with result 'exit-code'.
dub 08 12:27:06 server1 systemd[1]: Failed to start Samba SMB Daemon.
-- Subject: Unit smb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit smb.service has failed.
-- 
-- The result is RESULT.

Oh, I was being stupid (as usual), smbd et. al. apparently did not start when i used the -D -F switches … it seemed to me they are running, because i could access my shares in dolphin before, now I cannot anymore.

Still trying to get my samba setup working again, after migration to firewalld it never has worked for me again unless I stop the firewall service completely, even though i see samba and samba-client allowed in my default zone, and now this problem with smb etc. services adds to my confusion…

Edgar

Changed the original title, but as you can see this doesn’t change the subject of the replies.

Same problem here. Log files in /var/log/samba don’t show any additional information. Does anybody know how to increase the verbosity to get some helpful output for debugging?

Hi
This may be relevant…
https://lists.opensuse.org/opensuse-factory/2018-04/msg00278.html

I just set apparmor in complaint mode for /usr/sbin/nmbd and /usr/sbin/smbd.
That didn’t change anything.

I also set the log level of samba to 10. This is the output:

[2018/04/08 11:18:42.569007,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:3869(lp_load_ex)
  lp_load_ex: refreshing parameters
[2018/04/08 11:18:42.569025,  5, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1344(free_param_opts)
  Freeing parametrics:
[2018/04/08 11:18:42.569053,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:547(init_globals)
  Initialising global parameters
[2018/04/08 11:18:42.569100,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:2782(lp_do_section)
  Processing section "[global]"
  doing parameter log level = 10
[2018/04/08 11:18:42.569121,  5, pid=29598, effective(0, 0), real(0, 0)] ../lib/util/debug.c:744(debug_dump_status)
  INFO: Current debug levels:
    all: 10
    tdb: 10
    printdrivers: 10
    lanman: 10
    smb: 10
    rpc_parse: 10
    rpc_srv: 10
    rpc_cli: 10
    passdb: 10
    sam: 10
    auth: 10
    winbind: 10
    vfs: 10
    idmap: 10
    quota: 10
    acls: 10
    locking: 10
    msdfs: 10
    dmapi: 10
    registry: 10
    scavenger: 10
    dns: 10
    ldb: 10
    tevent: 10
    auth_audit: 10
    auth_json_audit: 10
    kerberos: 10
    drs_repl: 10
  doing parameter interfaces = enp1s0f0 enp1s0f1
  doing parameter server min protocol = SMB2
  doing parameter workgroup = STROMI
  doing parameter passdb backend = tdbsam
  doing parameter load printers = No
  doing parameter printcap name = /dev/null
  doing parameter disable spoolss = Yes
  doing parameter logon path = \\%L\profiles\.msprofile
  doing parameter logon home = \\%L\%U\.9xprofile
  doing parameter logon drive = P:
  doing parameter usershare allow guests = No
  doing parameter add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
  doing parameter domain logons = No
  doing parameter domain master = No
  doing parameter netbios name = GRANDPA
  doing parameter wins support = No
  doing parameter security = user
[2018/04/08 11:18:42.569338,  2, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:2799(lp_do_section)
  Processing section "[homes]"
[2018/04/08 11:18:42.569357,  8, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1460(add_a_service)
  add_a_service: Creating snum = 0 for homes
[2018/04/08 11:18:42.569370, 10, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1501(hash_a_service)
  hash_a_service: creating servicehash
[2018/04/08 11:18:42.569381, 10, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1510(hash_a_service)
  hash_a_service: hashing index 0 for service name homes
  doing parameter comment = Home Directories
  doing parameter valid users = %S, %D%w%S
  doing parameter browseable = No
  doing parameter read only = No
  doing parameter inherit acls = Yes
[2018/04/08 11:18:42.569431,  2, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:2799(lp_do_section)
  Processing section "[media]"
[2018/04/08 11:18:42.569448,  8, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1460(add_a_service)
  add_a_service: Creating snum = 1 for media
[2018/04/08 11:18:42.569460, 10, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1510(hash_a_service)
  hash_a_service: hashing index 1 for service name media
  doing parameter comment = Music, Videos, Pictures
  doing parameter inherit acls = Yes
  doing parameter path = /var/media
  doing parameter read only = No
[2018/04/08 11:18:42.569503,  4, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:3911(lp_load_ex)
  pm_process() returned Yes
[2018/04/08 11:18:42.569523,  8, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1460(add_a_service)
  add_a_service: Creating snum = 2 for IPC$
[2018/04/08 11:18:42.569536, 10, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1510(hash_a_service)
  hash_a_service: hashing index 2 for service name IPC$
[2018/04/08 11:18:42.569549,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:1617(lp_add_ipc)
  adding IPC service
[2018/04/08 11:18:42.569572,  6, pid=29598, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:2332(lp_file_list_changed)
  lp_file_list_changed()
  file /etc/samba/smb.conf -> /etc/samba/smb.conf  last mod_time: Sun Apr  8 10:59:17 2018
  
[2018/04/08 11:18:42.570031,  2, pid=29598, effective(0, 0), real(0, 0)] ../source3/lib/interface.c:345(add_interface)
  added interface enp1s0f0 ip=192.168.2.1 bcast=192.168.2.255 netmask=255.255.255.0
[2018/04/08 11:18:42.570054,  2, pid=29598, effective(0, 0), real(0, 0)] ../source3/lib/interface.c:345(add_interface)
  added interface enp1s0f1 ip=192.168.4.1 bcast=192.168.4.255 netmask=255.255.255.0
[2018/04/08 11:18:42.570076,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/smbd/server.c:1808(main)
  loaded services
[2018/04/08 11:18:42.570093,  5, pid=29598, effective(0, 0), real(0, 0)] ../source3/lib/util_names.c:152(init_names)
  Netbios name list:-
  my_netbios_names[0]="GRANDPA"
[2018/04/08 11:18:42.570136,  1, pid=29598, effective(0, 0), real(0, 0)] ../source3/profile/profile_dummy.c:30(set_profile_level)
  INFO: Profiling support unavailable in this build.
[2018/04/08 11:18:42.570160,  3, pid=29598, effective(0, 0), real(0, 0)] ../source3/smbd/server.c:1840(main)
  Becoming a daemon.
[2018/04/08 11:18:42.570206,  0, pid=29598, effective(0, 0), real(0, 0)] ../lib/util/become_daemon.c:124(exit_daemon)
  exit_daemon: STATUS=daemon failed to start: Failed to create session, error code 1

I can’t see anything helpful though …

I disabled apparmor and rebooted (just in case) but smbd still fails to start as a daemon.

Stuart

I have same problem. smb
mb starting as a daemon fails after update to samba 4.8.0 and systemd 237-2.2

If you comment out the -F -D option lines in /etc/sysconfig/samba

#NMBDOPTIONS="-D -F"
......
#SMBDOPTIONS="-D -F"

Samba will start with

systemclt start smb

I just played around with the start options. The -D option works. The only thing I noticed was this message:

smb.service: Supervising process 26213 which is not our child. We'll most likely not notice when it exits.

I don’t understand the purpose of the -F option. According to man pages -F " causes the main smbd process to not daemonize,…". To me it looks like -D and -F are conflicting options.

https://bugzilla.opensuse.org/show_bug.cgi?id=1088574