--- /etc/init.d/libvirt-bin~ 2007-12-21 14:47:35.000000000 +0000 +++ /etc/init.d/libvirt-bin 2007-12-21 14:50:14.000000000 +0000 @@ -22,7 +22,8 @@ test -x $DAEMON || exit 0 . /lib/lsb/init-functions -PIDFILE=/var/run/$NAME.pid +PIDDIR=/var/run/libvirt +PIDFILE=$PIDDIR/$NAME.pid DODTIME=1 # Time to wait for the server to die, in seconds # Include libvirtd defaults if available @@ -41,6 +42,12 @@ fi } +check_pid_dir() { + if [ ! -d "$PIDDIR" ]; then + mkdir -p $PIDDIR + fi +} + running_pid() { # Check if a given process pid's cmdline matches a given name @@ -89,6 +96,7 @@ case "$1" in start) if check_start_libvirtd_option; then + check_pid_dir log_daemon_msg "Starting $DESC" "$NAME" if running ; then log_progress_msg "already running" @@ -125,6 +133,7 @@ ;; restart) if check_start_libvirtd_option; then + check_pid_dir log_daemon_msg "Restarting $DESC" "$DAEMON" start-stop-daemon --oknodo --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON