ports/142244: net/samba3: startup script should remove pid files

Akinori MUSHA knu at FreeBSD.org
Sat Jan 2 16:40:04 UTC 2010


>Number:         142244
>Category:       ports
>Synopsis:       net/samba3: startup script should remove pid files
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 02 16:40:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Akinori MUSHA
>Release:        FreeBSD 8.0-STABLE amd64
>Organization:
>Environment:
FreeBSD daemon.musha.org 8.0-STABLE FreeBSD 8.0-STABLE #0: Thu Dec 31 03:33:36 JST 2009     root at daemon.musha.org:/var/cache/obj/usr/src/sys/DAEMON  amd64
>Description:
Samba daemons seem to leave pid files under /var/run/ even if they successfully shut down,
and the existence of ghost pid files cause problems in next startup.

I can observe nmbd instances increasing enormously on my box.

>How-To-Repeat:
/usr/local/etc/rc.d/samba start
/usr/local/etc/rc.d/samba stop
/usr/local/etc/rc.d/samba start

>Fix:
Make the rc script remove pid files after shutting down daemons.
I didn't check but this should also apply to other samba ports.

If the problem is on samba's side, please report this to the Samba team.

Patch attached with submission follows:

Index: files/samba.in
===================================================================
RCS file: /home/pcvs/ports/net/samba3/files/samba.in,v
retrieving revision 1.6
diff -u -r1.6 samba.in
--- files/samba.in	5 Jun 2007 10:55:06 -0000	1.6
+++ files/samba.in	2 Jan 2010 16:19:45 -0000
@@ -155,7 +155,10 @@
 	command="%%PREFIX%%/sbin/${name}"
 	pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid"
 	
-	run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args}
+	run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} &&
+	    if [ "${rc_arg}" = "stop" ]; then
+		rm -f -- "${pidfile}"
+	    fi
     done
 }
 


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list