2015-02-09 16:35:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# the following is the LSB init header see
|
2016-01-07 09:50:26 +01:00
|
|
|
# http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
|
2015-02-09 16:35:05 +00:00
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: virtlogd
|
2016-01-07 09:50:26 +01:00
|
|
|
# Default-Start: 3 4 5
|
|
|
|
# Default-Stop: 0 1 2 6
|
2015-12-02 07:54:28 +00:00
|
|
|
# Required-Start:
|
|
|
|
# Required-Stop:
|
|
|
|
# Should-Start: $network $remote_fs
|
|
|
|
# Should-Stop: $network $remote_fs
|
2015-02-09 16:35:05 +00:00
|
|
|
# Short-Description: virtual machine log manager
|
|
|
|
# Description: This is a daemon for managing logs
|
|
|
|
# of virtual machine consoles
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
# the following is chkconfig init header
|
|
|
|
#
|
|
|
|
# virtlogd: virtual machine log manager
|
|
|
|
#
|
2016-01-07 09:50:26 +01:00
|
|
|
# chkconfig: 345 96 04
|
2015-02-09 16:35:05 +00:00
|
|
|
# description: This is a daemon for managing logs \
|
|
|
|
# of virtual machine consoles
|
|
|
|
#
|
|
|
|
# processname: virtlogd
|
|
|
|
# pidfile: @localstatedir@/run/virtlogd.pid
|
|
|
|
#
|
|
|
|
|
|
|
|
# Source function library.
|
|
|
|
. @sysconfdir@/rc.d/init.d/functions
|
|
|
|
|
|
|
|
SERVICE=virtlogd
|
|
|
|
PROCESS=virtlogd
|
|
|
|
PIDFILE=@localstatedir@/run/$SERVICE.pid
|
|
|
|
|
|
|
|
VIRTLOGD_ARGS=
|
|
|
|
|
|
|
|
test -f @sysconfdir@/sysconfig/virtlogd && . @sysconfdir@/sysconfig/virtlogd
|
|
|
|
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
start() {
|
|
|
|
echo -n $"Starting $SERVICE daemon: "
|
|
|
|
daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $VIRTLOGD_ARGS
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
2015-12-31 16:09:12 +11:00
|
|
|
[ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE
|
2015-02-09 16:35:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
echo -n $"Stopping $SERVICE daemon: "
|
|
|
|
|
|
|
|
killproc -p $PIDFILE $PROCESS
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
if [ $RETVAL -eq 0 ]; then
|
2015-12-31 16:09:12 +11:00
|
|
|
rm -f @localstatedir@/lock/subsys/$SERVICE
|
2015-02-09 16:35:05 +00:00
|
|
|
rm -f $PIDFILE
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
|
|
|
echo -n $"Reloading $SERVICE configuration: "
|
|
|
|
|
|
|
|
killproc -p $PIDFILE $PROCESS -USR1
|
|
|
|
RETVAL=$?
|
|
|
|
echo
|
|
|
|
return $RETVAL
|
|
|
|
}
|
|
|
|
|
|
|
|
# See how we were called.
|
|
|
|
case "$1" in
|
|
|
|
start|stop|restart|reload)
|
|
|
|
$1
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
status -p $PIDFILE $PROCESS
|
|
|
|
RETVAL=$?
|
|
|
|
;;
|
|
|
|
force-reload)
|
|
|
|
reload
|
|
|
|
;;
|
|
|
|
condrestart|try-restart)
|
2015-12-31 16:09:12 +11:00
|
|
|
[ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
|
2015-02-09 16:35:05 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
|
|
|
|
exit 2
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit $RETVAL
|