Browse Source

%status and pidfile handling

master
Michael van Elst 23 years ago committed by Ralf S. Engelschall
parent
commit
773256ef0b
  1. 2
      cups/cups.spec
  2. 27
      cups/rc.cups

2
cups/cups.spec

@ -33,7 +33,7 @@ Distribution: OpenPKG [EVAL]
Group: Print Group: Print
License: GPL/LGPL with exceptions License: GPL/LGPL with exceptions
Version: 1.1.19 Version: 1.1.19
Release: 20030719 Release: 20030721
# package options # package options
%option with_openssl no %option with_openssl no

27
cups/rc.cups

@ -6,14 +6,33 @@
%config %config
cups_enable="$openpkg_rc_def" cups_enable="$openpkg_rc_def"
%common
cups_pidfile="@l_prefix@/var/cups/cupsd.pid"
cups_signal () {
[ -f $cups_pidfile ] && kill -$1 `cat $cups_pidfile`
}
%status -p 200 -u @l_susr@ -o
cups_usable="unknown"
cups_active="no"
rcService cups enable yes && \
cups_signal 0 && cups_active="yes"
echo "cups_enable=\"$cups_enable\""
echo "cups_usable=\"$cups_usable\""
echo "cups_active=\"$cups_active\""
%start -p 200 -u @l_susr@ %start -p 200 -u @l_susr@
rcService cups enable yes || exit 0 rcService cups enable yes || exit 0
@l_prefix@/libexec/cups/cupsd @l_prefix@/libexec/cups/cupsd
%stop -p 200 -u @l_susr@ %stop -p 200 -u @l_susr@
rcService cups enable yes || exit 0 rcService cups enable yes || exit 0
if [ -f @l_prefix@/var/cups/cupsd.pid ]; then cups_signal TERM
kill -TERM `cat @l_prefix@/var/cups/cupsd.pid` rm -f $cups_pidfile 2>/dev/null || true
rm -f @l_prefix@/var/cups/cupsd.pid >/dev/null 2>&1 || true
fi %restart -p 200 -u @l_susr@
rcService cups enable yes || exit 0
rc cups stop
sleep 2
rc cups start

Loading…
Cancel
Save