FS#36338 - [samba] Failed to delete pidfile /var/run/smbd.pid

Attached to Project: Arch Linux
Opened by Eric Wang (enihcam) - Wednesday, 31 July 2013, 02:25 GMT
Last edited by Tobias Powalowski (tpowa) - Tuesday, 29 March 2022, 19:43 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 8
Private No

Details

Description:
smbd.socket will cause the following errors when a samba connection is established:

Jul 31 08:11:29 archbox systemd[1]: Starting Samba SMB/CIFS server instance...
Jul 31 08:11:29 archbox systemd[1]: Started Samba SMB/CIFS server instance.
Jul 31 08:11:29 archbox smbd[1342]: [2013/07/31 08:11:29.723366, 0] ../source3/smbd/negprot.c:670(reply_negprot)
Jul 31 08:11:29 archbox smbd[1342]: No protocol supported !
Jul 31 08:11:29 archbox smbd[1342]: [2013/07/31 08:11:29.733052, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jul 31 08:11:29 archbox smbd[1342]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
Jul 31 08:11:45 archbox systemd[1]: Starting Samba SMB/CIFS server instance...
Jul 31 08:11:45 archbox systemd[1]: Started Samba SMB/CIFS server instance.
Jul 31 08:11:45 archbox smbd[1376]: [2013/07/31 08:11:45.637695, 0] ../source3/smbd/negprot.c:670(reply_negprot)
Jul 31 08:11:45 archbox smbd[1376]: No protocol supported !
Jul 31 08:11:45 archbox smbd[1376]: [2013/07/31 08:11:45.638330, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jul 31 08:11:45 archbox smbd[1376]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
Jul 31 08:11:45 archbox systemd[1]: Starting Samba SMB/CIFS server instance...
Jul 31 08:11:45 archbox systemd[1]: Started Samba SMB/CIFS server instance.
Jul 31 08:11:45 archbox smbd[1377]: [2013/07/31 08:11:45.669457, 0] ../source3/smbd/negprot.c:670(reply_negprot)
Jul 31 08:11:45 archbox smbd[1377]: No protocol supported !
Jul 31 08:11:45 archbox smbd[1377]: [2013/07/31 08:11:45.670140, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jul 31 08:11:45 archbox smbd[1377]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
Jul 31 08:11:46 archbox systemd[1]: Starting Samba SMB/CIFS server instance...
Jul 31 08:11:46 archbox systemd[1]: Started Samba SMB/CIFS server instance.
Jul 31 08:11:46 archbox smbd[1382]: [2013/07/31 08:11:46.703734, 0] ../source3/smbd/negprot.c:670(reply_negprot)
Jul 31 08:11:46 archbox smbd[1382]: No protocol supported !
Jul 31 08:11:46 archbox smbd[1382]: [2013/07/31 08:11:46.704264, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jul 31 08:11:46 archbox smbd[1382]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
Jul 31 08:11:46 archbox systemd[1]: Starting Samba SMB/CIFS server instance...
Jul 31 08:11:46 archbox systemd[1]: Started Samba SMB/CIFS server instance.
Jul 31 08:11:46 archbox smbd[1383]: [2013/07/31 08:11:46.734820, 0] ../source3/smbd/negprot.c:670(reply_negprot)
Jul 31 08:11:46 archbox smbd[1383]: No protocol supported !
Jul 31 08:11:46 archbox smbd[1383]: [2013/07/31 08:11:46.735543, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jul 31 08:11:46 archbox smbd[1383]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or director

Additional info:
* package version(s)
local/libwbclient 4.0.7-3
Samba winbind client library
local/samba 4.0.7-3
SMB Fileserver and AD Domain server

* config and/or log files etc.
smb.conf:
[global]
dos charset = CP936
server string = Archbox
interfaces = 192.168.1.0/24
bind interfaces only = Yes
map to guest = Bad User
guest account = samba
log file = /var/log/samba/%m.log
max log size = 50
server min protocol = SMB2
client max protocol = SMB3
client min protocol = SMB2
socket options = TCP_NODELAY IPTOS_THROUGHPUT SO_KEEPALIVE
load printers = No
printcap name = /dev/null
disable spoolss = Yes
dns proxy = No
create mask = 0664
directory mask = 0775
printing = bsd
unix extensions = No
use sendfile = Yes
write cache size = 262144

[Share]
comment = Archbox Share
path = /home/nanw/Share
read only = No
guest ok = Yes


Steps to reproduce:
1. pacman -Syu
2. pacman -S samba
3. Setup a share
4. systemctl enable smbd.socket && systemctl enable nmbd.service
5. reboot
6. connect to the share frequently.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Tuesday, 29 March 2022, 19:43 GMT
Reason for closing:  Fixed
Comment by Dan Andresan (forumache) - Monday, 05 August 2013, 11:25 GMT
The file /var/run/smbd.pid exists. But it's not so simple, actually /var/run is a link to /run.

So, /run/smbd.pid is the real filename. Maybe unlink cannot follow symlinks and that is why it cannot delete /var/run/smbd.pid?

Anyway, I think this could be easily solved if smbd.service and nmbd.service are updated to the new path /run (instead of /var/run)

Thanks,
Dan.
Comment by Dave Reisner (falconindy) - Monday, 05 August 2013, 14:29 GMT
You're looking at the wrong service for smbd. The socket activates smbd@.service, not smbd.service. The former has no PIDFile directive, and I'm assuming that passing the -F flag causes smbd to never write such a thing. Note that PIDFile= only tells systemd where to look to find the PID file -- it does NOT cause it to be created.

So, this is a bug in smbd. Not a very interesting one, either, since this doesn't really affect how the daemon runs.
Comment by Dan Andresan (forumache) - Tuesday, 06 August 2013, 08:23 GMT
Sorry, I didn't read the bug report carefully enough to see that the message is obtained in response to a socket connection. In my case, I get the message every time I stop smbd. Maybe I should create a new bug report then.
Comment by Paco (CaptainHook8) - Wednesday, 12 February 2014, 11:20 GMT
I get the same bug with samba version 4.1.4 using /lib/systemd/system/smbd.socket

[Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
2014/02/12 11:27:17.372563, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Comment by nvb (nvb) - Friday, 16 January 2015, 23:27 GMT
Error still exists:

Jan 17 00:10:03 <machine> smbd[2083]: [2015/01/17 00:10:03.419206, 0] ../lib/util/pidfile.c:153(pidfile_unlink)
Jan 17 00:10:03 <machine> smbd[2083]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory

extra/samba 4.1.15-1 [installed]
Comment by Pietro Pizzi (Pietro_Pizzi) - Monday, 04 May 2015, 19:59 GMT
Samba 4.2.1-1

smbd[...]: ["date", 0] ../lib/util/pidfile.c:153(pidfile_unlink)
smbd[...]: Failed to delete pidfile /var/run/smbd.pid. Error was No such file or directory
Comment by Eric Wang (enihcam) - Tuesday, 18 April 2017, 03:01 GMT
The issue still exists today.

Samba 4.5.8-1
Comment by Sylvain POULAIN (kikislater) - Tuesday, 18 April 2017, 16:01 GMT
Same problem for me with 4.5.8-1
Comment by Tobias Powalowski (tpowa) - Monday, 28 March 2022, 08:01 GMT
Is this still valid?

Loading...