#! /bin/sh -e ### BEGIN INIT INFO # Provides: uuidd # Required-Start: $time $local_fs $remote_fs # Required-Stop: $time $local_fs $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: uuidd daemon # Description: Init script for the uuid generation daemon ### END INIT INFO # # Author: "Theodore Ts'o" # set -e setvar PATH = "/bin:/usr/bin:/sbin:/usr/sbin" setvar DAEMON = '/usr/sbin/uuidd' setvar UUIDD_USER = 'uuidd' setvar UUIDD_GROUP = 'uuidd' setvar UUIDD_DIR = '/run/uuidd' setvar PIDFILE = "$UUIDD_DIR/uuidd.pid" test -x $DAEMON || exit 0 source /lib/lsb/init-functions match $1 { with start log_daemon_msg "Starting uuid generator" "uuidd" if ! test -d $UUIDD_DIR { mkdir -p $UUIDD_DIR chown -R $UUIDD_USER:$UUIDD_GROUP $UUIDD_DIR } start_daemon -p $PIDFILE $DAEMON log_end_msg $Status with stop log_daemon_msg "Stopping uuid generator" "uuidd" killproc -p $PIDFILE $DAEMON log_end_msg $Status with status if pidofproc -p $PIDFILE $DAEMON >/dev/null 2>&1 { echo "$DAEMON is running"; exit 0; } else { echo "$DAEMON is NOT running"; if test -f $PIDFILE { exit 2; } exit 3; } with force-reload|restart $0 stop $0 start with * echo "Usage: /etc/init.d/uuidd {start|stop|restart|force-reload}" exit 1 } exit 0