Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Nov 2005 15:50:16 GMT
From:      Vasil Dimov <vd@datamax.bg>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/87512: [patch] devel/distcc daemon cannot create pid file
Message-ID:  <200511041550.jA4FoGAc062308@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/87512; it has been noted by GNATS.

From: Vasil Dimov <vd@datamax.bg>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511041550.jA4FoGAc062308>