#!/bin/sh /lib/init/init-d-script
### 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

DAEMON=/usr/sbin/uuidd
DAEMON_ARGS="--cont-clock"
START_ARGS="--chuid uuidd:uuidd"
PIDFILE=/run/uuidd/uuidd.pid

do_start_prepare() {
	# Fallback directory creation in the absence of a tmpfiles.d implementation
	[ -d /run/uuidd ]        || install -d -m 2775 -o uuidd -g uuidd /run/uuidd
	[ -d /var/lib/libuuidd ] || install -d -m 2775 -o uuidd -g uuidd /var/lib/libuuidd
}

do_stop_cmd_override() {
	$DAEMON -k
}
