mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
Fix initscript to check daemon pidfile
The libvirtd initscript could get confused between the system and session instances of the daemon. To avoid this it is neccessary to check the pidfile explicitly. * daemon/libvirtd.init.in: Always check the pidfile of the system daemon to avoid confusion with the session daemons
This commit is contained in:
parent
308b85330a
commit
ce62916b6e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user