]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
virtlockd: improve initscripts
authorMichael Chapman <mike@very.puzzling.org>
Mon, 9 Dec 2013 06:23:26 +0000 (17:23 +1100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Dec 2013 11:02:37 +0000 (12:02 +0100)
- 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>
daemon/libvirtd.init.in
src/locking/virtlockd.init.in

index f66ddad91e8d317daece99c2b41ab1b2227ef9eb..ed42195cab10a14ef8645cf582a3aef5375d341d 100644 (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
index 1adea07c1c13e36e5724418376c7a5e4003999e9..596bb624148540b6cb507e281340a3b00e72b3c1 100644 (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
 #
 # 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