]> code.ossystems Code Review - openembedded-core.git/commitdiff
distcc: fix initscript can not stop distcc daemon correctly
authorHongxu Jia <hongxu.jia@windriver.com>
Thu, 22 Jan 2015 09:09:14 +0000 (17:09 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 28 Jan 2015 21:22:21 +0000 (21:22 +0000)
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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/distcc/files/distcc

index c7c414d8296c2f5305f0a1ede479fb5464937be3..e36f0fa6950e305aa823b0fbc5ed52e2d7cae2d4 100755 (executable)
@@ -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
        }