Files
Ikey Doherty 5bfc504fda Introduce remainder of Ubuntu support
Note Ubuntu does not currently use or properly support systemd, so we
cannot obtain a nice systemd-analyze output. So for now we'll just emit
the "uptime" number, which is entirely incorrect but cannot be helped,
and is just a formatting placeholder until Ubuntu 14.10 stable supports
systemd.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2014-08-07 18:01:50 +01:00

62 lines
1.4 KiB
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: vm-timing-report
# Required-Start: $syslog $remote_fs $network
# Required-Stop: $syslog $remote_fs $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the vm-timing-report service
# Description: VM Timing Report script
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/vm-report
NAME=vm-timing-report
DESC="VM Timing Report"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
test -x $DAEMON || exit 0
set -e
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $DESC" $NAME
if ! start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
then
log_end_msg 1
else
log_end_msg 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC" $NAME
if start-stop-daemon --stop --retry 30 --quiet \
--pidfile $PIDFILE --exec $DAEMON
then
rm -f $PIDFILE
log_end_msg 0
else
log_end_msg 1
fi
;;
restart)
$0 stop
$0 start
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" vm-timing-report && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0