commit ca312378a4c7b37a8fb895aa5bb9b74ee79f7a48
Author: Radek Novacek <rnovacek(a)redhat.com>
Date: Mon Sep 5 12:28:42 2011 +0200
Make initscript to use pidfile
virt-who-initscript | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/virt-who-initscript b/virt-who-initscript
index 7688eb3..0efb89c 100644
--- a/virt-who-initscript
+++ b/virt-who-initscript
@@ -23,6 +23,7 @@
exec="/usr/bin/virt-who"
prog="virt-who"
config="/etc/sysconfig/virt-who"
+pidfile="/var/run/$prog.pid"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
@@ -35,8 +36,7 @@ start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
echo -n $"Starting $prog: "
- # if not running, start it up here, usually something like "daemon $exec"
- daemon $exec
+ daemon --pidfile $pidfile $exec
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
@@ -45,8 +45,7 @@ start() {
stop() {
echo -n $"Stopping $prog: "
- # stop it here, often "killproc $prog"
- killproc $prog
+ killproc -p $pidfile $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
@@ -67,8 +66,7 @@ force_reload() {
}
rh_status() {
- # run checks to determine if the service is running or use generic status
- status $prog
+ status -p $pidfile $prog
}
rh_status_q() {
Show replies by date