LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2019, 11:54 AM   #1
Lestrad
LQ Newbie
 
Registered: Mar 2015
Posts: 17

Rep: Reputation: Disabled
Samba fails: "Failed to create pipe directory"


Hello. I have upgraded Samba from version 4.8. to version 4.10.10 to try to solve this problem, but it continues:

I am able to start and enable the smb.service and then connect to the shares on my Wandboard Quad from my Windows and Linux desktop computers. But if I reboot the Wandboard Samba fails with the following output (****..****" added by me for emphasis):


Code:
smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
   Active: ****failed**** (Result: exit-code) since Sun 2019-11-10 14:05:56 CET; 1min 52s ago
     Docs: man:smbd(8)
           man:samba(7)
           man:smb.conf(5)
  Process: 398 ExecStart=/usr/bin/smbd --foreground --no-process-group $SMBDOPTIONS (code=exited, status=255/EXCEPTION)
 Main PID: 398 (code=exited, status=255/EXCEPTION)
   Status: "Starting process..."

Nov 10 14:05:54 alarm systemd[1]: Starting Samba SMB Daemon...
Nov 10 14:05:56 alarm smbd[398]: [2019/11/10 14:05:56.104125,  0] ../../source3/smbd/server.c:2074(main)
Nov 10 14:05:56 alarm smbd[398]:  ****Failed to create pipe directory /run/samba/ncalrpc - No such file or directory****
Nov 10 14:05:56 alarm systemd[1]: smb.service: Main process exited, code=exited, status=255/EXCEPTION
Nov 10 14:05:56 alarm systemd[1]: smb.service: Failed with result 'exit-code'.
Nov 10 14:05:56 alarm systemd[1]: Failed to start Samba SMB Daemon.
If I create the /run/samba/ncalrpc directory I can successfully start the smb.service and after that again connect to the shares from other computers. But if I reboot Samba again fails to start and I see the same output as above. And the /run/samba/ncalrpc directory I created has disappeared.

This is the same problem I was experiencing with Samba version 4.8. I see that it has been documented here and there for some time, but I have never found a solution. Any suggestions would be appreciated.

TIA
Les
 
Old 11-13-2019, 12:22 PM   #2
tfrans
LQ Newbie
 
Registered: Sep 2014
Posts: 1

Rep: Reputation: Disabled
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.
 
Old 11-13-2019, 02:09 PM   #3
Lestrad
LQ Newbie
 
Registered: Mar 2015
Posts: 17

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tfrans View Post
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.
Thanks! samba.conf exists in /usr/lib/tmpfiles.d/, and it contains these two lines:


Code:
D /run/samba 0755 - - -
d /var/log/samba 0755 - - -
As I mentioned, if I create the directory manually - as root or as the user "alarm" - samba then works but won't start after a reboot. It seems to get wiped out when I reboot. By what, and why, I don't know.

I'll try a reinstall of samba-common. Since I'm on Arch Linux it'll have to be pacman and not yum...

[later] Here's the result:

Code:
[alarm@alarm ~]$ sudo pacman -S samba-common
error: target not found: samba-common
[alarm@alarm ~]$

Last edited by Lestrad; 11-13-2019 at 02:24 PM.
 
Old 11-15-2019, 09:16 AM   #4
bgstack15
Member
 
Registered: Jul 2017
Distribution: korora
Posts: 69

Rep: Reputation: Disabled
Ugly hack of an idea: Update the smb.service file to run a mkdir -p /run/samba/ncalrpc. Probably a PreExec command.

Wow, I've never known about the /usr/lib/tmpfiles.d/ directory, thanks! I guess you just want to make sure you have an entry for the /run/samba/ncalrpc even if you have to write it yourself, but it does indeed sound like a package manager thing.
 
Old 11-16-2019, 01:16 PM   #5
Lestrad
LQ Newbie
 
Registered: Mar 2015
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks! Might be worth trying.

Quote:
Probably a PreExec command.
Could you go into a little detail about PreExec? Below is my service.smb:

Code:
[Unit]
Description=Samba SMB Daemon
Documentation=man:smbd(8) man:samba(7) man:smb.conf(5)
Wants=network-online.target
After=network.target network-online.target nmb.service winbind.service

[Service]
Type=notify
NotifyAccess=all
PIDFile=/run/smbd.pid
LimitNOFILE=16384
EnvironmentFile=-/etc/conf.d/samba
ExecStart=/usr/bin/smbd --foreground --no-process-group $SMBDOPTIONS
ExecReload=/bin/kill -HUP $MAINPID
LimitCORE=infinity


[Install]
WantedBy=multi-user.target

But what I really want to know is what or who is blowing the directory away when I create it and then reboot.
 
Old 11-20-2019, 09:45 AM   #6
Lestrad
LQ Newbie
 
Registered: Mar 2015
Posts: 17

Original Poster
Rep: Reputation: Disabled
Solution

I found it here. Very much what bgstack15 suggested.

Thanks to all who showed interest. I'll post the text of the solution I found below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Samba (smb and nmb services) cannot be started, because /var/run/samba
directory does not exist.

Reproducible: Always

Steps to Reproduce:
1. systemctl start smb.service

Actual Results:
systemd[1]: Starting Samba SMB Daemon...
smbd[2173]: [2014/02/02 19:52:47.463767, 0]
./source3/smbd/server.c:1278(main)
smbd[2173]: standard input is not a socket, assuming -D option
smbd[2204]: [2014/02/02 19:52:47.464517, 0]
-../lib/util/pidfile.c:117(pidfile_create)
smbd[2204]: ERROR: can't open /var/run/samba/smbd.pid: Error was No such file
or directory
systemd[1]: PID file /run/samba/smbd.pid not /readable (yet?) after start.
systemd[1]: Failed to start Samba SMB Daemon.
systemd[1]: Unit smb.service entered failed state.


Expected Results:
It should just start

If I add the following line to /usr/lib/systemd/system/smb.service, smb can be
started:
ExecStartPre=/usr/bin/mkdir -p /var/run/samba

Same for nmb.service
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP shell_exec() always gives error "Broken pipe" when using pipe burek Linux - Server 1 01-19-2012 07:04 AM
samba does not create "samba/netlogon" and "samba/profiles" mianmajidali Linux - Server 0 04-27-2008 06:07 AM
Help With Java Problem Please"""""""""""" suemcholan Linux - Newbie 1 04-02-2008 07:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration