3 # qemu-ga qemu-ga QEMU Guest Agent
7 # description: qemu-ga QEMU Guest Agent
9 # Source function library
10 . /etc/rc.d/init.d/functions
12 # Get service config - may override defaults
13 [ -f /etc/sysconfig/qemu-ga ] && . /etc/sysconfig/qemu-ga
15 pidfile="/var/run/qemu-ga.pid"
18 # must return non-zero if check failed
19 # output is discarded if checkconfig is ran without details
25 # wrapper for configtest
29 if [ $details = 1 ]; then
30 # run config test and display report (status action)
31 show "Checking %s configuration" "qemu-ga"; busy
33 out=$(configtest 2>&1)
35 if [ $RETVAL = 0 ]; then
40 [ "$out" ] && echo >&2 "$out"
42 # run config test and abort with nice message if failed
43 # (for actions checking status before action).
44 configtest >/dev/null 2>&1
46 if [ $RETVAL != 0 ]; then
47 show "Checking %s configuration" "qemu-ga"; fail
48 nls 'Configuration test failed. See details with %s "checkconfig"' $0
55 # Check if the service is already running?
56 if [ -f /var/lock/subsys/qemu-ga ]; then
57 msg_already_running "qemu-ga"
62 msg_starting "qemu-ga"
63 daemon /usr/bin/qemu-ga -d -l /var/log/qemu-ga
65 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/qemu-ga
69 if [ ! -f /var/lock/subsys/qemu-ga ]; then
70 msg_not_running "qemu-ga"
75 msg_stopping "qemu-ga"
76 killproc --pidfile $pidfile qemu-ga -TERM
77 rm -f /var/lock/subsys/qemu-ga
81 if [ ! -f /var/lock/subsys/qemu-ga ]; then
82 msg_not_running "qemu-ga"
93 # See how we were called.
112 checkconfig|configtest)
116 status --pidfile $pidfile qemu-ga
120 msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"