ports/106436: Samba startup script uses old PID files naming scheme
Rashid N. Achilov
shelton at master.askd.ru
Thu Dec 7 07:20:10 UTC 2006
>Number: 106436
>Category: ports
>Synopsis: Samba startup script uses old PID files naming scheme
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Thu Dec 07 07:20:06 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Rashid N. Achilov
>Release: FreeBSD 6.1-RELEASE i386
>Organization:
LLC "AS-System Complex"
>Environment:
System: FreeBSD to-495.askd.ru 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Tue Oct 31 13:28:26 NOVT 2006 root at sentry.askd.ru:/usr/obj/usr/src/sys/Sentry i386
>Description:
Samba startup script 'samba', placed into /usr/local/etc/rc.d, incorrectly detects
their PID file names and try to use 'smbd.pid','nmbd.pid' and 'winbindd.pid', but
Samba now produces 'smbd-smb,conf.pid', 'nmbd-smb.conf.pid' and 'winbindd-smb.conf.pid'
files. So, user cannot stop or restart Samba, it must kill it manually
>How-To-Repeat:
Install Samba 3.0.23d
Start it.
Try to restart or stop. Script samba suddenly says: smbd not running? and so on
>Fix:
--- pidfilesh.patch begins here ---
--- samba.old.old Thu Dec 7 10:25:13 2006
+++ samba.old Thu Dec 7 13:03:09 2006
@@ -47,6 +47,9 @@
samba_daemons="${samba_daemons} winbindd"
testparm_command="/usr/local/bin/testparm"
smbcontrol_command="/usr/local/bin/smbcontrol"
+
+short_cfgname=${samba_config##*/}
+
# Fetch parameters from configuration file
samba_parm="${testparm_command} -s -v --parameter-name"
samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null)
@@ -123,7 +126,7 @@
for name in ${samba_daemons}; do
rcvar=$(set_rcvar)
command="/usr/local/sbin/${name}"
- pidfile="/var/run/${name}.pid"
+ pidfile="/var/run/${name}-${short_cfgname}.pid"
# Daemon should be enabled and running
if [ -n "${rcvar}" ] && checkyesno ${rcvar}; then
if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then
@@ -147,7 +150,7 @@
for name in ${samba_daemons}; do
rcvar=$(set_rcvar)
command="/usr/local/sbin/${name}"
- pidfile="/var/run/${name}.pid"
+ pidfile="/var/run/${name}-${short_cfgname}.pid"
run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
done
--- pidfilesh.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list