Skip to contentSkip to conversation

distcc: fix initscript can not stop distcc daemon correctly

PATCH New Hongxu Jia 1 participant 2 messages Jan 22, 2015

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover distcc: fix initscript can not stop distcc daemon correctly

The following changes since commit c45589a55c67bfd0bf9da5050141f4d18835e113:

poky.conf: mark all CentOS 6/7 versions as compatible (2015-01-12 13:31:08 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/fix-distcc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-distcc

Hongxu Jia (1):
distcc: fix initscript can not stop distcc daemon correctly

 meta/recipes-devtools/distcc/files/distcc | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 distcc: fix initscript can not stop distcc daemon correctly

The distcc's initscript has used option '--pid-file' to save daemon process id, but it didn't to create that file, that caused start/stop distcc daemon failed.

We refer what Ubuntu 14.04 did, create pid file before start and delete it after stop

[YOCTO #7090]

---
 meta/recipes-devtools/distcc/files/distcc | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/distcc/files/distcc +5 -0
index c7c414d..e36f0fa 100755
@@ -51,6 +51,9 @@ should_start() {
 		echo "$DAEMON not starting"
 		exit 0
 	fi
+	# we need permission to write to the pid file
+	touch /var/run/$NAME.pid
+	chown distcc /var/run/$NAME.pid
 }
 
 case "$1" in
@@ -75,6 +78,7 @@ case "$1" in
 	    echo "$0: stop failed with error code $code" >&2
 	    exit $code
 	}
+	rm -f /var/run/$NAME.pid >/dev/null 2>&1
 	echo "."
 	;;
   restart|force-reload)
@@ -92,6 +96,7 @@ case "$1" in
 		--exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
 	{
 	    code=$?
+	    rm -f /var/run/$NAME.pid >/dev/null 2>&1
 	    echo "$0: restart failed with error code $code" >&2
 	    exit $code
 	}
Signature · 1 line
1.9.1