virtlockd: improve initscripts

- Use SIGUSR1, not SIGHUP, on reload. At present, virtlockd only
  responds to the former.

- Fix PID file for virtlockd.

- Do not start virtlockd in any runlevels by default. It needs to be
  explicitly selected in libvirt's qemu.conf anyway, so there is no
  need to have it running on all systems regardless.

- Fix chkconfig priorities to ensure virtlockd is started before
  libvirtd is started, and stopped after libvirtd is stopped.

- Add "Should-Start: virtlockd" to the libvirtd initscript's LSB header,
  for the same reason.

- Add "Default-Stop" to both libvirtd and virtlockd initscripts. LSB
  does not guarantee that this defaults to the inverse of
  "Default-Start".

Signed-off-by: Michael Chapman <mike@very.puzzling.org>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michael Chapman 2013-12-09 17:23:26 +11:00 committed by Michal Privoznik
parent 1163fa36b7
commit 59d6e65d6c
2 changed files with 8 additions and 5 deletions

View File

@ -9,9 +9,11 @@
# Should-Start: $named
# Should-Start: xend
# Should-Start: avahi-daemon
# Should-Start: virtlockd
# Required-Stop: $network messagebus
# Should-Stop: $named
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: daemon for libvirt virtualization API
# Description: This is a daemon for managing guest instances
# and libvirt virtual networks

View File

@ -5,7 +5,8 @@
#
### BEGIN INIT INFO
# Provides: virtlockd
# Default-Start: 3 4 5
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: virtual machine lock manager
# Description: This is a daemon for managing locks
# on virtual machine disk images
@ -15,12 +16,12 @@
#
# virtlockd: virtual machine lock manager
#
# chkconfig: 345 97 03
# chkconfig: - 96 04
# description: This is a daemon for managing locks \
# on virtual machine disk images
#
# processname: virtlockd
# pidfile: @localstatedir@/run/libvirt/virtlockd.pid
# pidfile: @localstatedir@/run/virtlockd.pid
#
# Source function library.
@ -28,7 +29,7 @@
SERVICE=virtlockd
PROCESS=virtlockd
PIDFILE=@localstatedir@/run/libvirt/lockd/$SERVICE.pid
PIDFILE=@localstatedir@/run/$SERVICE.pid
VIRTLOCKD_ARGS=
@ -64,7 +65,7 @@ restart() {
reload() {
echo -n $"Reloading $SERVICE configuration: "
killproc -p $PIDFILE $PROCESS -HUP
killproc -p $PIDFILE $PROCESS -USR1
RETVAL=$?
echo
return $RETVAL