Date: Thu, 29 Mar 2012 14:10:32 GMT From: Oliver Hartmann <ohartman@zedat.fu-berlin.de> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/166493: net/samba rc.d-srcipt not applicable to TMPFS driven /var/run Message-ID: <201203291410.q2TEAWhE058204@red.freebsd.org> Resent-Message-ID: <201203291420.q2TEK74Z033147@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 166493 >Category: ports >Synopsis: net/samba rc.d-srcipt not applicable to TMPFS driven /var/run >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Mar 29 14:20:07 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Oliver Hartmann >Release: FreeBSD 10.0-CURRENT >Organization: FU Berlin >Environment: >Description: Using SAMBA server in combination with TMPFS-backed up /var/run folder fails starting the SAMBA server since the folder /var/run/samba needs to be created at the start time of the SAMBA server. By adding a simple check to the rc.d-start script /usr/local/etc/rc.d/samba like a check done by "dbus" or "hald" circumvents this problem. >How-To-Repeat: >Fix: Apply the attached patch/hack to the rc.d script provided by the port. Patch attached with submission follows: --- samba.orig 2012-03-29 16:04:34.000000000 +0200 +++ samba 2012-03-29 15:51:59.000000000 +0200 @@ -84,6 +84,12 @@ samba_checkconfig() { echo -n "Performing sanity check on Samba configuration: " + + # Test existence of /var/run/samba folder + if [ ! -d "/var/run/samba" ]; then + mkdir -p "/var/run/samba" + fi + if ${testparm_command} -s ${samba_config:+"${samba_config}"} >/dev/null 2>&1; then echo "OK" else @@ -118,14 +124,14 @@ } samba_reload_cmd() { - local name rcvar command pidfile + local name rcvar command #pidfile # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Apply to all daemons for name in ${samba_daemons}; do rcvar=${name}_enable command="/usr/local/sbin/${name}" - pidfile="/var/run/samba/${name}${pid_extra}.pid" + #pidfile="/var/run/samba/${name}${pid_extra}.pid" # Daemon should be enabled and running if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then if [ -n "$(check_pidfile "${pidfile}" "${command}")" ]; then @@ -139,7 +145,7 @@ } samba_cmd() { - local name rcvar rcvars v command pidfile samba_daemons result + local name rcvar rcvars v command samba_daemons result # Prevent recursive calling unset "${rc_arg}_cmd" "${rc_arg}_precmd" "${rc_arg}_postcmd" # Stop processes in the reverse order @@ -154,7 +160,7 @@ # XXX rcvars=''; v='' command="/usr/local/sbin/${name}" - pidfile="/var/run/samba/${name}${pid_extra}.pid" + #pidfile="/var/run/samba/${name}${pid_extra}.pid" # Daemon should be enabled and running if [ -n "${rcvar}" ] && checkyesno "${rcvar}"; then run_rc_command "${_rc_prefix}${rc_arg}" ${rc_extra_args} >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203291410.q2TEAWhE058204>