4 # Required-Start: $time $local_fs
5 # Required-Stop: $time $local_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: uuidd daemon
9 # Description: Init script for the uuid generation daemon
12 # Author: "Theodore Ts'o" <tytso@mit.edu>
16 # libuuid is able to execute the uuid daemon on-demand -- in such a case
17 # the daemon binary must be setuid to an unprivileged user (e.g. uuidd:uuidd).
19 UUIDD_ON_DEMAND_ONLY="no"
21 PATH=/bin:/usr/bin:/sbin:/usr/sbin
22 DAEMON=/usr/sbin/uuidd
25 UUIDD_DIR=/var/run/uuidd
26 PIDFILE=$UUIDD_DIR/uuidd.pid
28 test -x $DAEMON || exit 0
30 . /lib/lsb/init-functions
34 log_daemon_msg "Starting uuid generator" "uuidd"
35 if ! test -d $UUIDD_DIR; then
37 chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_DIR
39 if test "$UUIDD_ON_DEMAND_ONLY" = yes; then
40 echo -n "(on demand only)"
42 start_daemon -p $PIDFILE $DAEMON
47 log_daemon_msg "Stopping uuidd generator" "uuidd"
48 killproc -p $PIDFILE $DAEMON
52 if pidofproc -p $PIDFILE $DAEMON >& /dev/null ; then
53 echo "$DAEMON is running";
56 echo "$DAEMON is NOT running";
57 if test -f $PIDFILE; then exit 2; fi
66 echo "Usage: /etc/init.d/uuidd {start|stop|restart|force-reload}"