diff --git a/daemon/libvirtd.init.in b/daemon/libvirtd.init.in index 43c2d686a0..071fe2c0a4 100644 --- a/daemon/libvirtd.init.in +++ b/daemon/libvirtd.init.in @@ -40,6 +40,7 @@ SERVICE=libvirtd PROCESS=libvirtd +PIDFILE=@localstatedir@/run/$SERVICE.pid LIBVIRTD_CONFIG= LIBVIRTD_ARGS= @@ -59,7 +60,7 @@ start() { echo -n $"Starting $SERVICE daemon: " mkdir -p @localstatedir@/cache/libvirt rm -rf @localstatedir@/cache/libvirt/* - KRB5_KTNAME=$KRB5_KTNAME daemon --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS + KRB5_KTNAME=$KRB5_KTNAME daemon --pidfile $PIDFILE --check $SERVICE $PROCESS --daemon $LIBVIRTD_CONFIG_ARGS $LIBVIRTD_ARGS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch @localstatedir@/lock/subsys/$SERVICE @@ -68,12 +69,12 @@ start() { stop() { echo -n $"Stopping $SERVICE daemon: " - killproc $PROCESS + killproc -p $PIDFILE $PROCESS RETVAL=$? echo if [ $RETVAL -eq 0 ]; then rm -f @localstatedir@/lock/subsys/$SERVICE - rm -f @localstatedir@/run/$SERVICE.pid + rm -f $PIDFILE rm -rf @localstatedir@/cache/libvirt/* fi } @@ -86,7 +87,7 @@ restart() { reload() { echo -n $"Reloading $SERVICE configuration: " - killproc $PROCESS -HUP + killproc -p $PIDFILE $PROCESS -HUP RETVAL=$? echo return $RETVAL @@ -98,7 +99,7 @@ case "$1" in $1 ;; status) - status $PROCESS + status -p $PIDFILE $PROCESS RETVAL=$? ;; force-reload)