]> TLD Linux GIT Repositories - rc-scripts.git/blob - src/testdinit
- from PLD
[rc-scripts.git] / src / testdinit
1 #!/bin/sh
2 #
3 # testd         This shell script takes care of starting and stopping
4 #               testd (example daemon).
5 #
6
7 # Source function library.
8 . /etc/rc.d/init.d/functions
9
10 # See how we were called.
11 case "$1" in
12   start)
13         # Start daemons.
14         echo -n "Starting testd: "
15         testd &
16         echo
17         touch /var/lock/subsys/testd
18         ;;
19   stop)
20         # Stop daemons.
21         echo -n "Shutting down testd: "
22         killproc testd
23         echo
24         rm -f /var/lock/subsys/testd
25         ;;
26   status)
27         # Am I alive?
28         status testd
29         exit $?
30         ;;
31   restart)
32         echo -n "Shutting down testd: "
33         killproc testd
34         echo
35         echo -n "Starting testd: "
36         testd &
37         echo
38         ;;
39   *)
40         echo "Usage: testd {start|stop|status|restart}"
41         exit 1
42 esac
43
44 exit 0