Error starting samba, missing /run/samba directory

General support questions
ngrusz1
Posts: 6
Joined: 2017/11/03 18:17:36

Error starting samba, missing /run/samba directory

Post by ngrusz1 » 2018/01/27 04:40:52

A recent samba update appears to have broken my samba install, and I'm wondering if anyone else has run into this issue or knows how to fix it. I noticed it one day after I rebooted my system and the samba service did not start properly.

After checking systemd I noticed the following errors when the samba service attempts to start:

Code: Select all

Jan 26 22:13:11 localhost systemd[1]: smb.service: Supervising process 1891 which is not our child. We'll most likely not no... exits.
Jan 26 22:13:11 localhost smbd[1891]: [2018/01/26 22:13:11.343429,  0] ../lib/util/util.c:216(directory_create_or_exist)
Jan 26 22:13:11 localhost smbd[1891]:   mkdir failed on directory /run/samba/ncalrpc: No such file or directory
Jan 26 22:13:11 localhost smbd[1891]: [2018/01/26 22:13:11.343602,  0] ../source3/smbd/server.c:1912(main)
Jan 26 22:13:11 localhost smbd[1891]:   Failed to create pipe directory /run/samba/ncalrpc - No such file or directory
Jan 26 22:13:11 localhost systemd[1]: smb.service: main process exited, code=exited, status=255/n/a
Jan 26 22:13:11 localhost systemd[1]: Failed to start Samba SMB Daemon.
Jan 26 22:13:11 localhost systemd[1]: Unit smb.service entered failed state.
Jan 26 22:13:11 localhost systemd[1]: smb.service failed.
I checked the /run directory and sure enough, there was no samba folder. Doing a simple mkdir /run/samba seems to fix the problem -- after creating this directory, the service will start just fine:

Code: Select all

Jan 26 22:15:32 localhost systemd[1]: smb.service: Supervising process 19798 which is not our child. We'll most likely not n... exits.
Jan 26 22:15:32 localhost smbd[19790]: [2018/01/26 22:15:32.676816,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 26 22:15:32 localhost smbd[19790]:   Unknown parameter encountered: "user"
Jan 26 22:15:32 localhost smbd[19798]: [2018/01/26 22:15:32.694903,  0] ../lib/util/become_daemon.c:124(daemon_ready)
Jan 26 22:15:32 localhost smbd[19798]:   STATUS=daemon 'smbd' finished starting up and ready to serve connections
Jan 26 22:15:32 localhost systemd[1]: Started Samba SMB Daemon.
If I reboot my system, however, the /run/samba directory magically goes away, and the samba service will not restart on its own. I will need to manually create the /run/samba directory again so I can start samba.

My current samba version is samba-4.6.2-12.el7_4.x86_64. Unfortunately I don't know exactly when it broke, but I'm pretty sure this is the first broken version (that is, the package immediately before this one was ok). I have not tinkered with my samba config since I initially set it up and everything was just fine; it was only after a recent yum package update that it seemed to break. Any ideas?

User avatar
TrevorH
Forum Moderator
Posts: 24083
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error starting samba, missing /run/samba directory

Post by TrevorH » 2018/01/27 13:45:50

The directory ought to be created by systemd-tmpfiles.d at boot time based on the content of /usr/lib/tmpfiles.d/samba.conf which is supplied by the samba-common package. Does that file exist? If not then perhaps a yum reinstall samba-common might help.

Might want to investigate the message you get even when it does start:

Jan 26 22:15:32 localhost smbd[19790]: Unknown parameter encountered: "user"
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

ngrusz1
Posts: 6
Joined: 2017/11/03 18:17:36

Re: Error starting samba, missing /run/samba directory

Post by ngrusz1 » 2018/01/27 20:37:42

Interestingly, the /usr/lib/tmpfiles.d/samba.conf file does exist, but it's empty. I will try reinstalling samba to see if that works; I'll post a response once I do.

ngrusz1
Posts: 6
Joined: 2017/11/03 18:17:36

Re: Error starting samba, missing /run/samba directory

Post by ngrusz1 » 2018/01/27 21:15:22

Ok reinstalling the samba-common package appears to have resolved the issue. After doing "yum reinstall samba-common-4.6.2-12.el7_4.noarch" I checked the /usr/lib/tmpfiles.d/samba.conf file and it now contains this:

Code: Select all

d /var/run/samba  755 root root
d /run/samba  755 root root
I have no idea how the contents of that file got blown away; like I noted before, the problem happened after a yum update, so perhaps one of the update packages was corrupt. I'm currently looking into the other errors noted above:

Code: Select all

Jan 27 14:38:55 localhost systemd: Starting Samba SMB Daemon...
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342292,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "only user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342477,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "only user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342542,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342562,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342612,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "only user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342630,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "only user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342668,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342688,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342755,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342783,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342825,  0] ../lib/param/loadparm.c:782(lpcfg_map_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Unknown parameter encountered: "only user"
Jan 27 14:38:55 localhost smbd[21956]: [2018/01/27 14:38:55.342905,  0] ../lib/param/loadparm.c:1791(lpcfg_do_service_parameter)
Jan 27 14:38:55 localhost smbd[21956]:  Ignoring unknown parameter "only user"
Jan 27 14:38:55 localhost systemd: smb.service: Supervising process 21961 which is not our child. We'll most likely not notice when it exits.
Jan 27 14:38:55 localhost smbd[21961]: [2018/01/27 14:38:55.363959,  0] ../lib/util/become_daemon.c:124(daemon_ready)
Jan 27 14:38:55 localhost smbd[21961]:  STATUS=daemon 'smbd' finished starting up and ready to serve connections
Jan 27 14:38:55 localhost systemd: Started Samba SMB Daemon.
These appear to be due to some deprecated references in my /etc/samba/smb.conf file. The user and only user directives are older and don't appear to be supported in Samba V4. Removing them does not appear to have broken anything on my network, and it has stopped the start-up errors from occurring:

Code: Select all

Jan 27 14:59:15 localhost systemd[1]: Starting Samba SMB Daemon...
Jan 27 14:59:15 localhost systemd[1]: smb.service: Supervising process 24545 which is not our child. We'll most likely not notice when it exits.
Jan 27 14:59:15 localhost smbd[24545]: [2018/01/27 14:59:15.850459,  0] ../lib/util/become_daemon.c:124(daemon_ready)
Jan 27 14:59:15 localhost smbd[24545]:   STATUS=daemon 'smbd' finished starting up and ready to serve connections
Jan 27 14:59:15 localhost systemd[1]: Started Samba SMB Daemon.
So I think everything is now fixed! Thanks! :D

User avatar
Caio Narezzi
Posts: 6
Joined: 2018/02/02 00:59:00

Re: Error starting samba, missing /run/samba directory

Post by Caio Narezzi » 2018/02/02 01:05:43

Hello Good evening, I'm going through the same problem friends, my samba simply does not start anymore, when readily the:

SYSTEMCTL status SMB. Service and SYSTEMCTL status NMB. Service

alarm smbd[696]: STATUS=daemon 'smbd' finished starting up and ready to serve connections

Who can give me a light, ja reinstalled Samba-client and samba-common and nothing to start the service of SMBD and NMBD, I'm with the server stopped almost a day already help me :oops:

User avatar
TrevorH
Forum Moderator
Posts: 24083
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error starting samba, missing /run/samba directory

Post by TrevorH » 2018/02/02 07:13:16

If you have teh exact same problem then

yum reinstall samba-common
systemd-tmpfiles --create /usr/lib/tmpfiles.d/samba.conf

should fix it (or the first command then a reboot)
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
Caio Narezzi
Posts: 6
Joined: 2018/02/02 00:59:00

Re: Error starting samba, missing /run/samba directory

Post by Caio Narezzi » 2018/02/02 10:59:55

OK, I did what you asked me and nothing, did the testparm he brought me an error message or something like that

Message from the testparm: Idmap config *: beckend = TDP

I do not know what that means within my SMB. conf but I put and nothing too.

The error happened when I try to give \\server in Windows and the Windows error message is that ' ' Destination port inaccessible ' ' I do not know what else to do

I'm kind of new to the world of servers, forgive me for being a layman :roll:

User avatar
TrevorH
Forum Moderator
Posts: 24083
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Error starting samba, missing /run/samba directory

Post by TrevorH » 2018/02/02 11:08:53

beckend?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
Caio Narezzi
Posts: 6
Joined: 2018/02/02 00:59:00

Re: Error starting samba, missing /run/samba directory

Post by Caio Narezzi » 2018/02/02 11:12:57

Yes, beckend, I've never seen it but in another forum a guy managed to tidy up just putting this in the SMB. conf


https://archlinuxarm.org/forum/viewtopi ... =58&t=9119

pjsr2
Posts: 343
Joined: 2014/03/27 20:11:07

Re: Error starting samba, missing /run/samba directory

Post by pjsr2 » 2018/02/02 12:49:05

Message from the testparm: Idmap config *: beckend = TDP
https://archlinuxarm.org/forum/viewtopi ... =58&t=9119 says:

Code: Select all

 idmap config * : backend = tdb
Do you have the same three typing errors in your config file as in your post here in the forum?

Post Reply