]> git.pld-linux.org Git - packages/hplip.git/blob - hplip.init
- missing /etc/hp dir
[packages/hplip.git] / hplip.init
1 #!/bin/sh
2 #
3 #
4 # hplip         hplip
5 #
6 # chkconfig:    2345 80 20
7 # description:  Startup/shutdown script for HPLIP
8 # processname:  hpiod hpssd.py
9 #
10
11 # Source function library
12 . /etc/rc.d/init.d/functions
13
14 # Get service config - may override defaults
15 [ -f /etc/sysconfig/hplip ] && . /etc/sysconfig/hplip
16
17 RETVAL=0
18 # See how we were called.
19 case "$1" in
20   start)
21         # Check if the service is already running?
22         if [ ! -f /var/lock/subsys/hpiod ]; then
23                 msg_starting hpiod
24                 daemon /usr/sbin/hpiod
25                 RETVAL=$?
26                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hpiod
27         else
28                 msg_already_running hpiod
29         fi
30         if [ ! -f /var/lock/subsys/hpssd ]; then
31                 msg_starting hpssd
32                 daemon /usr/sbin/hpssd
33                 RETVAL=$?
34                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/hpssd
35         else
36                 msg_already_running hpssd
37         fi
38         ;;
39   stop)
40         # Stop daemons.
41         if [ -f /var/lock/subsys/hpiod ]; then
42                 msg_stopping hpiod
43                 killproc hpiod
44                 rm -f /var/lock/subsys/hpiod >/dev/null 2>&1
45         else
46                 msg_not_running hpiod
47         fi
48         if [ -f /var/lock/subsys/hpssd ]; then
49                 msg_stopping hpssd
50                 killproc hpssd
51                 rm -f /var/lock/subsys/hpssd >/dev/null 2>&1
52         else
53                 msg_not_running hpssd
54         fi
55         ;;
56   restart)
57         $0 stop
58         $0 start
59         exit $?
60         ;;
61   status)
62         status hpiod hpiod
63         status hpssd hpssd
64         exit $?
65         ;;
66   *)
67         msg_usage "$0 {start|stop|restart|status}"
68         exit 3
69 esac
70
71 exit $RETVAL
This page took 0.047178 seconds and 3 git commands to generate.