mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
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] (From OE-Core rev: 3b0d6c7c324f0283cfab10445d1a5a3bf2526598) (From OE-Core rev: b9dc92ae6efbedcca4e21479412d6d4954c05bce) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d3953fcb40
commit
82c567748a
@@ -51,6 +51,9 @@ should_start() {
|
|||||||
echo "$DAEMON not starting"
|
echo "$DAEMON not starting"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
# we need permission to write to the pid file
|
||||||
|
touch /var/run/$NAME.pid
|
||||||
|
chown distcc /var/run/$NAME.pid
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -75,6 +78,7 @@ case "$1" in
|
|||||||
echo "$0: stop failed with error code $code" >&2
|
echo "$0: stop failed with error code $code" >&2
|
||||||
exit $code
|
exit $code
|
||||||
}
|
}
|
||||||
|
rm -f /var/run/$NAME.pid >/dev/null 2>&1
|
||||||
echo "."
|
echo "."
|
||||||
;;
|
;;
|
||||||
restart|force-reload)
|
restart|force-reload)
|
||||||
@@ -92,6 +96,7 @@ case "$1" in
|
|||||||
--exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
|
--exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
|
||||||
{
|
{
|
||||||
code=$?
|
code=$?
|
||||||
|
rm -f /var/run/$NAME.pid >/dev/null 2>&1
|
||||||
echo "$0: restart failed with error code $code" >&2
|
echo "$0: restart failed with error code $code" >&2
|
||||||
exit $code
|
exit $code
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user