From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Nov 4 15:50:16 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2AEB16A41F for ; Fri, 4 Nov 2005 15:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8267243D48 for ; Fri, 4 Nov 2005 15:50:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jA4FoGUh062309 for ; Fri, 4 Nov 2005 15:50:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jA4FoGAc062308; Fri, 4 Nov 2005 15:50:16 GMT (envelope-from gnats) Date: Fri, 4 Nov 2005 15:50:16 GMT Message-Id: <200511041550.jA4FoGAc062308@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Vasil Dimov Cc: Subject: Re: ports/87512: [patch] devel/distcc daemon cannot create pid file X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Vasil Dimov List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2005 15:50:16 -0000 The following reply was made to PR ports/87512; it has been noted by GNATS. From: Vasil Dimov To: bug-followup@FreeBSD.org, mnag@FreeBSD.org Cc: vs@freebsd.org Subject: Re: ports/87512: [patch] devel/distcc daemon cannot create pid file Date: Fri, 4 Nov 2005 17:47:06 +0200 Here is a patch (against current version of the port) that makes distcc daemon not to remove it's pid file when exiting, thus not emitting "permission denied" warning. --- distcc_pid.diff begins here --- diff -urN --exclude=CVS --exclude=README.html distcc.orig/Makefile distcc/Makefile --- distcc.orig/Makefile Tue Feb 1 10:31:56 2005 +++ distcc/Makefile Fri Nov 4 17:39:20 2005 @@ -7,6 +7,7 @@ PORTNAME= distcc PORTVERSION= 2.18.3 +PORTREVISION= 1 CATEGORIES= devel ipv6 MASTER_SITES= http://distcc.samba.org/ftp/distcc/ @@ -19,6 +20,7 @@ USE_BZIP2= yes USE_GMAKE= yes GNU_CONFIGURE= yes +CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} WANT_GNOME= yes CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" DISTCCD_PIDFILE=/var/run/distccd.pid diff -urN --exclude=CVS --exclude=README.html distcc.orig/files/distccd.sh.sample distcc/files/distccd.sh.sample --- distcc.orig/files/distccd.sh.sample Tue Feb 1 10:31:56 2005 +++ distcc/files/distccd.sh.sample Fri Nov 4 17:38:43 2005 @@ -22,7 +22,19 @@ rcvar=`set_rcvar` command=%%PREFIX%%/sbin/${name} -pidfile=%%DISTCCD_PIDFILE%% +# extract pid file from distccd_flags (if any) +pidfile="`echo ${distccd_flags} |sed -nE -e 's/^.*-P ([^ ]+).*$/\1/p'`" +# set default value +pidfile=${pidfile:-%%DISTCCD_PIDFILE%%} + +distccd_precmd() +{ + # distccd drops root privileges and then attempts to create the pid file + touch ${pidfile} + chown distcc:distcc ${pidfile} +} + +start_precmd="distccd_precmd" load_rc_config ${name} run_rc_command "$1" diff -urN --exclude=CVS --exclude=README.html distcc.orig/files/patch-src-dparent.c.diff distcc/files/patch-src-dparent.c.diff --- distcc.orig/files/patch-src-dparent.c.diff Thu Jan 1 02:00:00 1970 +++ distcc/files/patch-src-dparent.c.diff Fri Nov 4 17:35:21 2005 @@ -0,0 +1,20 @@ +--- src/dparent.c.orig Sun Oct 24 08:05:48 2004 ++++ src/dparent.c Fri Nov 4 17:35:09 2005 +@@ -285,6 +285,9 @@ + **/ + void dcc_remove_pid(void) + { ++ /* distcc user, we are running as, cannot delete files in /var/run ++ */ ++#if 0 + if (!arg_pid_file) + return; + +@@ -292,6 +295,7 @@ + rs_log_warning("failed to remove pid file %s: %s", + arg_pid_file, strerror(errno)); + } ++#endif + } + + --- distcc_pid.diff begins here --- -- Vasil Dimov