~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to utopic/etc/init.d/hpsockd

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
### BEGIN INIT INFO
4
 
# Provides:          hpsockd
5
 
# Required-Start:    $remote_fs $syslog
6
 
# Required-Stop:     $remote_fs $syslog
7
 
# Default-Start:     2 3 4 5
8
 
# Default-Stop:      0 1 6
9
 
# Short-Description: start and stop the HP Socks daemon
10
 
# Description:       hpsockd is a Socks Daemon
11
 
### END INIT INFO
12
 
 
13
 
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14
 
DAEMON=/usr/sbin/hpsockd
15
 
NAME=hpsockd
16
 
DESC="HP SOCKS daemon"
17
 
 
18
 
test -f $DAEMON || exit 0
19
 
 
20
 
set -e
21
 
 
22
 
case "$1" in
23
 
  start)
24
 
        if [ -f /etc/hpsockd.conf ]; then
25
 
                echo -n "Starting $DESC: "
26
 
                start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
27
 
                        --exec $DAEMON
28
 
                echo "$NAME."
29
 
        else
30
 
                echo "Not starting $DESC: no config file."
31
 
        fi
32
 
        ;;
33
 
  stop)
34
 
        echo -n "Stopping $DESC: "
35
 
        start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
36
 
                --exec $DAEMON
37
 
        echo "$NAME."
38
 
        ;;
39
 
  reload|force-reload)
40
 
        echo "Reloading $DESC configuration files."
41
 
        /usr/sbin/sdc reload
42
 
  ;;
43
 
  restart)
44
 
        echo -n "Restarting $DESC: "
45
 
        start-stop-daemon --stop --quiet --pidfile \
46
 
                /var/run/$NAME.pid --exec $DAEMON
47
 
        sleep 1
48
 
        start-stop-daemon --start --quiet --pidfile \
49
 
                /var/run/$NAME.pid --exec $DAEMON
50
 
        echo "$NAME."
51
 
        ;;
52
 
  *)
53
 
        N=/etc/init.d/$NAME
54
 
        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
55
 
        exit 1
56
 
        ;;
57
 
esac
58
 
 
59
 
exit 0