From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Oct 22 11:50:02 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79B67E69 for ; Mon, 22 Oct 2012 11:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7728FC12 for ; Mon, 22 Oct 2012 11:50:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9MBo2hR051415 for ; Mon, 22 Oct 2012 11:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9MBo2DW051414; Mon, 22 Oct 2012 11:50:02 GMT (envelope-from gnats) Resent-Date: Mon, 22 Oct 2012 11:50:02 GMT Resent-Message-Id: <201210221150.q9MBo2DW051414@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Hartmann Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 38D7AE4D for ; Mon, 22 Oct 2012 11:48:57 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC818FC14 for ; Mon, 22 Oct 2012 11:48:57 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9MBmu0q013494 for ; Mon, 22 Oct 2012 11:48:56 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9MBmuLL013493; Mon, 22 Oct 2012 11:48:56 GMT (envelope-from nobody) Message-Id: <201210221148.q9MBmuLL013493@red.freebsd.org> Date: Mon, 22 Oct 2012 11:48:56 GMT From: Oliver Hartmann To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/172954: net/samba: fails to start when /var/run is of filesystem-type tmpfs X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2012 11:50:02 -0000 >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: