Error starting samba, missing /run/samba directory

General support questions
User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2018/06/20 16:24:57

Are you using our samba packages?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hous3810
Posts: 5
Joined: 2018/06/15 16:54:17

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

Post by hous3810 » 2018/06/21 20:30:43

Yep using the latest samba from regular yum repo.

Think I determined what it was. Fact that other directories in /run were missing led me to believe something was amiss. Sure enough there were bunch of services showing not being loaded in journalctl. The thing is it was not consistent. Even however if samba did load there will still other services that did not start in journalctl.

The only other thing I did was mount a drive for Samba shares. Turns out that a piece of legacy in my mount directives from when I was using network storage on a physical server before bringing over to vms was causing the issue. I had the _netdev option set on the mount. I removed it as it isn't needed, but it shouldn't generate this error anyways. Old file servers have no issue with it on a ext4 mount. Have been rebooting with no issues at all now. Journalctl is clear of any services that are not starting. I didn't see any problem with moving my old /ext4 vmdk disks to a new VM so I could just rebuild the system with the latest version of samba, just shouldn't have copied the fstab entry :).

Would like to know what changed and caused this issue, not seeing that using _netdev will be problematic. _netdev shouldn't be a problem as it says in the man pages it should only fire off if it is declared as nfs, ext4 should just ignore it. Just a funky way to find out this problem, samba not working was just the most evident of the services that were not loading. Here's to errors that aren't 100% reproducible. I actually rebooted a test vm 20 times with no failed boots before which gave me hope, but it was just luck...

junichi
Posts: 2
Joined: 2019/01/17 07:36:13

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

Post by junichi » 2019/01/17 07:41:56

for those having the same error, i was able to resolve the error by following steps.

step 1. make sure /run/samba is not in the clear list in /usr/lib/smpfiles.d/tmp.conf
# Clear tmp directories separately, to make them easier to override
v /tmp 1777 root root 10d
v /var/tmp 1777 root root 30d
step 2. add the hyphen at the end of each line in /usr/lib/tmpfiles.d/samba.conf
d /var/run/samba 755 root root -
d /run/samba 755 root root -
step 3. cross your fingers and reboot ;)

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2019/01/17 07:52:03

No idea if that's a correct solution or not but editing files in /usr/lib/tmpfiles.d is going to get backed out next time there is an update to the package that owns them. The correct way to change them is to copy them to /etc/tmpfiles.d and edit them there. Files in /usr/lib/tmpfiles.d are not designed to be changed directly and will be reset to defaults when the owning package is updated.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

junichi
Posts: 2
Joined: 2019/01/17 07:36:13

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

Post by junichi » 2019/01/17 08:21:33

TrevorH, You are right. i should copy /usr/lib/tmpfiles.d/samba.conf to /etc/tmpfiles.d and then modify it.
if i copy it over to etc directory, it did create /run/samba directory on reboot even without the hyphen at the end.

if the config is only in /usr/lib/tmpfiles.d, it wont work without the hyphen but it works if the exact same config is in /etc/tmpfiles.d ..

this statement in manual only applies to files under /etc/tmpfiles.d then?
"The age field only applies to lines starting with d, D, and x. If omitted or set to "-", no automatic clean-up is done"

Post Reply