ports/172954: net/samba: fails to start when /var/run is of filesystem-type tmpfs
Oliver Hartmann
ohartman at zedat.fu-berlin.de
Mon Oct 22 11:50:02 UTC 2012
>Number: 172954
>Category: ports
>Synopsis: net/samba: fails to start when /var/run is of filesystem-type tmpfs
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Oct 22 11:50:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Oliver Hartmann
>Release: FreeBSD 9.0-STABLE/amd64, FreeBSD 10.0-CURRENT/amd64 (CLANG built)
>Organization:
FU Berlin
>Environment:
>Description:
When /var/run is of filesystem type "tmpfs", port net/samba3[56] fail to startup since the PID file is created as /var/run/samba/xxx.pid in folder /var/run/samba/. Since the startup script located in /usr/local/etc/rc.d/ does not check for the existence of the folder and creates the folder samba in root folder /var/run, the PID file can not be created since the target folder is missing.
>How-To-Repeat:
Use /var/run as filesystem-type tmpfs, install port net/samba36 (or net/samba/35) adn try to start service via command
service samba36 start
>Fix:
Apply the attached changes to the port's file files/samba.in.
Patch attached with submission follows:
--- samba.in.orig 2012-10-22 13:37:35.000000000 +0200
+++ samba.in 2012-10-22 13:40:08.000000000 +0200
@@ -48,8 +48,19 @@
samba_daemons="nmbd smbd"
%%WINBIND%%samba_daemons="${samba_daemons} winbindd"
+pidfile="%%SAMBA_RUNDIR%%/${name}${pid_extra}.pid"
+
+if [ ! -d $(dirname ${pidfile}) ]; then
+ mkdir -p $(dirname ${pidfile})
+fi
+
+
samba_checkconfig() {
echo -n "Performing sanity check on Samba configuration: "
+ if [ ! -d $(dirname ${pidfile}) ]; then
+ mkdir -p $(dirname ${pidfile})
+ fi
+
if ${testparm_command} -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then #"
echo "OK"
else
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list