]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/uuidd.rc.in
Merge branch 'dmverity_options' of https://github.com/bluca/util-linux
[thirdparty/util-linux.git] / misc-utils / uuidd.rc.in
CommitLineData
815427c7
KZ
1#! /bin/sh -e
2### BEGIN INIT INFO
3# Provides: uuidd
89c80bd2
AH
4# Required-Start: $time $local_fs $remote_fs
5# Required-Stop: $time $local_fs $remote_fs
815427c7
KZ
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#
14set -e
15
815427c7
KZ
16PATH=/bin:/usr/bin:/sbin:/usr/sbin
17DAEMON=/usr/sbin/uuidd
18UUIDD_USER=uuidd
19UUIDD_GROUP=uuidd
8df54559 20UUIDD_DIR=@runstatedir@/uuidd
815427c7
KZ
21PIDFILE=$UUIDD_DIR/uuidd.pid
22
23test -x $DAEMON || exit 0
24
25. /lib/lsb/init-functions
26
27case "$1" in
28 start)
29 log_daemon_msg "Starting uuid generator" "uuidd"
30 if ! test -d $UUIDD_DIR; then
31 mkdir -p $UUIDD_DIR
32 chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_DIR
33 fi
928601e6 34 start_daemon -p $PIDFILE $DAEMON
815427c7
KZ
35 log_end_msg $?
36 ;;
37 stop)
570a9300 38 log_daemon_msg "Stopping uuid generator" "uuidd"
815427c7
KZ
39 killproc -p $PIDFILE $DAEMON
40 log_end_msg $?
41 ;;
42 status)
43 if pidofproc -p $PIDFILE $DAEMON >/dev/null 2>&1; then
44 echo "$DAEMON is running";
45 exit 0;
46 else
47 echo "$DAEMON is NOT running";
48 if test -f $PIDFILE; then exit 2; fi
49 exit 3;
50 fi
51 ;;
52 force-reload|restart)
53 $0 stop
54 $0 start
55 ;;
56 *)
57 echo "Usage: /etc/init.d/uuidd {start|stop|restart|force-reload}"
58 exit 1
59 ;;
60esac
61
62exit 0