提交 ce62916b 编写于 作者: D Daniel P. Berrange

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
上级 308b8533
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册