]>
Commit | Line | Data |
---|---|---|
740837de TT |
1 | #! /bin/sh -e |
2 | ### BEGIN INIT INFO | |
3 | # Provides: uuidd | |
4 | # Required-Start: $time $local_fs | |
5 | # Required-Stop: $time $local_fs | |
6 | # Default-Start: 2 3 4 5 | |
7 | # Default-Stop: 0 1 6 | |
8 | # Short-Description: uuidd daemon | |
9 | # Description: Init script for the uuid generation daemon | |
10 | ### END INIT INFO | |
11 | # | |
12 | # Author: "Theodore Ts'o" <tytso@mit.edu> | |
13 | # | |
14 | set -e | |
15 | ||
16 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | |
17 | DAEMON=/usr/sbin/uuidd | |
18 | PIDFILE=/var/run/uuidd/uuidd.pid | |
19 | ||
20 | test -x $DAEMON || exit 0 | |
21 | ||
22 | . /lib/lsb/init-functions | |
23 | ||
24 | case "$1" in | |
25 | start) | |
26 | log_daemon_msg "Starting uuid generator" "uuidd" | |
27 | start_daemon -p $PIDFILE $DAEMON | |
28 | log_end_msg $? | |
29 | ;; | |
30 | stop) | |
31 | log_daemon_msg "Stopping uuidd generator" "uuidd" | |
32 | killproc -p $PIDFILE $DAEMON | |
33 | log_end_msg $? | |
34 | ;; | |
35 | status) | |
36 | if pidofproc -p $PIDFILE $DAEMON >& /dev/null ; then | |
37 | echo "$DAEMON is running"; | |
38 | exit 0; | |
39 | else | |
40 | echo "$DAEMON is NOT running"; | |
41 | if test -f /var/run/uuidd.pid; then exit 2; fi | |
42 | exit 3; | |
43 | fi | |
44 | ;; | |
45 | force-reload|restart) | |
46 | $0 stop | |
47 | $0 start | |
48 | ;; | |
49 | *) | |
50 | echo "Usage: /etc/init.d/uuidd {start|stop|restart|force-reload}" | |
51 | exit 1 | |
52 | ;; | |
53 | esac | |
54 | ||
55 | exit 0 |