diff options
Diffstat (limited to 'net-print/hplip/files/hplip.init.d')
-rw-r--r-- | net-print/hplip/files/hplip.init.d | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net-print/hplip/files/hplip.init.d b/net-print/hplip/files/hplip.init.d new file mode 100644 index 000000000000..b7425ace6646 --- /dev/null +++ b/net-print/hplip/files/hplip.init.d @@ -0,0 +1,40 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-print/hplip/files/hplip.init.d,v 1.1 2005/06/07 17:02:33 lanius Exp $ + +depend() { + before cupsd + after hotplug + use net +} + +start() { + ebegin "Starting hpiod" + start-stop-daemon --start --quiet --exec /usr/sbin/hpiod + eend $? + + ebegin "Starting hpssd" + start-stop-daemon --quiet --start --exec /usr/share/hplip/hpssd.py \ + --pidfile /var/run/hpssd.pid >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping hpiod" + start-stop-daemon --stop --quiet -n hpiod + eend $? + + ebegin "Stopping hpssd" + start-stop-daemon --stop --pidfile /var/run/hpssd.pid + RETVAL=$? + for PIDFILE in /var/run/*; do + case "$( basename $PIDFILE )" in + hpguid-*.pid) + read PID < $PIDFILE + kill $PID + rm $PIDFILE + esac + done + eend $RETVAL +} |