source: salt-server/trunk/fuentes/debian/salt-server.init @ 473

Last change on this file since 473 was 473, checked in by daduve, 4 years ago

Adding files

File size: 2.4 KB
Line 
1#! /bin/sh
2#
3# skeleton      example file to build /etc/init.d/ scripts.
4#               This file should be used to construct scripts for /etc/init.d.
5#
6#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7#               Modified for Debian
8#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
9#
10# Version:      @(#)skeleton  1.9  26-Feb-2001  miquels@cistron.nl
11#
12
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
14DAEMON=/usr/bin/sltsrv
15#DAEMONOPTS=$DAEMON" -x['/usr/lib','/usr/share/salt-server','/usr/share/salt-server/py']"
16NAME=sltsrv
17DESC=SaltServer
18
19test -x $DAEMON || exit 0
20
21# Include util-linux defaults if available
22#if [ -f /etc/default/util-linux ] ; then
23#       . /etc/default/util-linux
24#fi
25
26set -e
27
28case "$1" in
29  start)
30        echo -n "Starting $DESC: "
31        HOME=/root $DAEMON &
32        #start-stop-daemon -a "$DAEMONOPTS" --start --quiet --pidfile /var/run/$NAME.pid \
33        #       --exec $DAEMON &
34        echo "$NAME."
35        sleep 1
36        ;;
37  stop)
38        echo -n "Stopping $DESC: "
39        for i in `pidof -x "sltsrv"` ; do sudo kill -9 $i ; done
40        #start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
41        #       --exec $DAEMONOPTS || exit 0
42        echo "$NAME."
43        ;;
44  #reload)
45        #
46        #       If the daemon can reload its config files on the fly
47        #       for example by sending it SIGHUP, do it here.
48        #
49        #       If the daemon responds to changes in its config file
50        #       directly anyway, make this a do-nothing entry.
51        #
52        # echo "Reloading $DESC configuration files."
53        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
54        #       /var/run/$NAME.pid --exec $DAEMON
55  #;;
56  force-reload)
57        #
58        #       If the "reload" option is implemented, move the "force-reload"
59        #       option to the "reload" entry above. If not, "force-reload" is
60        #       just the same as "restart" except that it does nothing if the
61        #   daemon isn't already running.
62        # check wether $DAEMON is running. If so, restart
63        for i in `pidof -x "sltsrv"` ; do sudo kill -9 $i ; done
64        #start-stop-daemon --stop --test --quiet --pidfile \
65        #       /var/run/$NAME.pid --exec $DAEMON  && $0 restart \
66        #|| exit 0
67        $0 restart || exit 0
68        ;;
69  restart)
70    echo -n "Restarting $DESC: "
71        #start-stop-daemon --stop --quiet --pidfile \
72        #       /var/run/$NAME.pid --exec $DAEMON || exit 0
73        for i in `pidof -x "sltsrv"` ; do sudo kill -9 $i ; done
74        sleep 1
75        #start-stop-daemon --start --quiet --pidfile \
76        #       /var/run/$NAME.pid --exec $DAEMON &
77        echo "$NAME."
78        ;;
79  *)
80        N=/etc/init.d/$NAME
81        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
82        echo "Usage: $N {start|stop|restart|force-reload}" >&2
83        exit 1
84        ;;
85esac
86
87exit 0
Note: See TracBrowser for help on using the repository browser.