Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Dec 2006 13:13:14 +0600 (NOVT)
From:      "Rashid N. Achilov" <shelton@master.askd.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/106436: Samba startup script uses old PID files naming scheme
Message-ID:  <200612070713.kB77DEtm053825@to-495.askd.ru>
Resent-Message-ID: <200612070720.kB77K7kS010531@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612070713.kB77DEtm053825>