From: Marcin Krol Date: Sat, 11 Feb 2017 18:44:28 +0000 (+0000) Subject: - TLDized init files X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=bbb630256f425fcee20b8f8067b21653bda4a86a;p=packages%2Flibvirt.git - TLDized init files --- diff --git a/virtlockd.init b/virtlockd.init new file mode 100755 index 0000000..6e50e70 --- /dev/null +++ b/virtlockd.init @@ -0,0 +1,94 @@ +#!/bin/bash + +# virtlockd: virtual machine lock manager +# +# chkconfig: 345 96 04 +# description: This is a daemon for managing locks +# on virtual machine disk images +# +# processname: virtlockd +# + +VIRTLOCKD_ARGS= + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source config +if [ -f /etc/sysconfig/virtlockd ] ; then + . /etc/sysconfig/virtlockd +fi + +start() { + if [ -f /var/lock/subsys/virtlockd ]; then + msg_already_running "virtlockd" + return + fi + + umask 077 + msg_starting "virtlockd" + daemon /usr/sbin/virtlockd --daemon $VIRTLOCKD_CONFIG_ARGS $VIRTLOCKD_ARGS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtlockd +} + +stop() { + if [ ! -f /var/lock/subsys/virtlockd ]; then + msg_not_running "virtlockd" + return + fi + + msg_stopping "virtlockd" + killproc virtlockd + rm -f /var/lock/subsys/virtlockd +} + + +reload() { + if [ ! -f /var/lock/subsys/virtlockd ]; then + msg_not_running "virtlockd" + RETVAL=7 + return + fi + + msg_reloading virtlockd + killproc virtlockd -HUP + RETVAL=$? +} + +condrestart() { + if [ ! -f /var/lock/subsys/virtlockd ]; then + msg_not_running "virtlockd" + RETVAL=$1 + return + fi + stop + start +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + try-restart) + condrestart 0 + ;; + reload|force-reload) + reload + ;; + status) + status libvirtd + ;; + *) + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" + exit 3 +esac +exit $RETVAL diff --git a/virtlogd.init b/virtlogd.init new file mode 100755 index 0000000..ea20eff --- /dev/null +++ b/virtlogd.init @@ -0,0 +1,94 @@ +#!/bin/bash + +# virtlogd: virtual machine log manager +# +# chkconfig: 345 96 04 +# description: This is a daemon for managing logs +# of virtual machine consoles +# +# processname: virtlogd +# + +VIRTLOGD_ARGS= + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source config +if [ -f /etc/sysconfig/virtlogd ] ; then + . /etc/sysconfig/virtlogd +fi + +start() { + if [ -f /var/lock/subsys/virtlogd ]; then + msg_already_running "virtlogd" + return + fi + + umask 077 + msg_starting "virtlogd" + daemon /usr/sbin/virtlogd --daemon $VIRTLOGD_CONFIG_ARGS $VIRTLOGD_ARGS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/virtlogd +} + +stop() { + if [ ! -f /var/lock/subsys/virtlogd ]; then + msg_not_running "virtlogd" + return + fi + + msg_stopping "virtlogd" + killproc virtlogd + rm -f /var/lock/subsys/virtlogd +} + + +reload() { + if [ ! -f /var/lock/subsys/virtlogd ]; then + msg_not_running "virtlogd" + RETVAL=7 + return + fi + + msg_reloading virtlogd + killproc virtlogd -HUP + RETVAL=$? +} + +condrestart() { + if [ ! -f /var/lock/subsys/virtlogd ]; then + msg_not_running "virtlogd" + RETVAL=$1 + return + fi + stop + start +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + try-restart) + condrestart 0 + ;; + reload|force-reload) + reload + ;; + status) + status libvirtd + ;; + *) + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" + exit 3 +esac +exit $RETVAL