From c68dab470adfce46043448ece06a56cefd7ad495 Mon Sep 17 00:00:00 2001 From: Michael van Elst Date: Mon, 21 Jul 2003 10:07:55 +0000 Subject: [PATCH] %status and pidfile handling --- uucp/rc.uucp | 24 ++++++++++++++++-------- uucp/uucp.spec | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/uucp/rc.uucp b/uucp/rc.uucp index b0b85aaf00..35da6497e3 100644 --- a/uucp/rc.uucp +++ b/uucp/rc.uucp @@ -8,18 +8,24 @@ %common uucp_pidfile="@l_prefix@/var/uucp/run/uucpd.pid" + uucp_signal () { + [ -f $uucp_pidfile ] && kill -$1 `cat $uucp_pidfile` + } uucp_start () { ( @l_prefix@/sbin/uucpd uucp @l_prefix@/sbin/uucico -l \ /dev/null 2>&1 & echo "$!" >$uucp_pidfile ) /dev/null 2>&1 } - uucp_stop () { - if [ -f $uucp_pidfile ]; then - kill -TERM `cat $uucp_pidfile` - sleep 1 - fi - } + +%status -p 200 -u @l_susr@ -o + uucp_usable="unknown" + uucp_active="no" + rcService uucp enable yes && \ + uucp_signal 0 && uucp_active="yes" + echo "uucp_enable=\"$uucp_enable\"" + echo "uucp_usable=\"$uucp_usable\"" + echo "uucp_active=\"$uucp_active\"" %start -p 200 -u @l_susr@ rcService uucp enable yes || exit 0 @@ -27,10 +33,12 @@ %stop -p 200 -u @l_susr@ rcService uucp enable yes || exit 0 - uucp_stop + uucp_signal TERM + rm -f $uucp_pidfile 2>/dev/null || true %restart -u @l_susr@ rcService uucp enable yes || exit 0 - uucp_stop + uucp_signal TERM + sleep 2 uucp_start diff --git a/uucp/uucp.spec b/uucp/uucp.spec index 57e8c8b449..0e63bf7296 100644 --- a/uucp/uucp.spec +++ b/uucp/uucp.spec @@ -33,7 +33,7 @@ Distribution: OpenPKG [BASE] Group: Communication License: GPL Version: 1.07 -Release: 20030719 +Release: 20030721 # list of sources Source0: ftp://ftp.gnu.org/gnu/uucp/uucp-%{version}.tar.gz