From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aliguori@linux.vnet.ibm.com, mdroth@linux.vnet.ibm.com
Subject: [Qemu-devel] [PATCH 4/5] guest tools: qemu-ga, redhat init scripts
Date: Mon, 22 Aug 2011 12:09:19 -0500 [thread overview]
Message-ID: <1314032960-23474-5-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1314032960-23474-1-git-send-email-mdroth@linux.vnet.ibm.com>
Init files for redhat/fedora guests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
.../projects/qemu-ga/redhat/qemu-ga.init | 97 ++++++++++++++++++++
.../projects/qemu-ga/redhat/qemu-ga.sysconfig | 14 +++
2 files changed, 111 insertions(+), 0 deletions(-)
create mode 100755 guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.init
create mode 100644 guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.sysconfig
diff --git a/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.init b/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.init
new file mode 100755
index 0000000..fe7bc98
--- /dev/null
+++ b/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.init
@@ -0,0 +1,97 @@
+#!/bin/sh
+#
+# qemu-ga Control the QEMU guest agent
+#
+# Author: Adam Litke <agl@us.ibm.com>
+#
+# Copyright 2011 IBM, and/or its affiliates.
+# Released under the GPL
+#
+# chkconfig: 2345 50 40
+# description: The QEMU guest agent provides a mechanism for communication \
+# with a QEMU host and a host<->guest command API.
+# processname: qemu-ga
+# pidfile: /var/run/qemu-ga.pid
+#
+### BEGIN INIT INFO
+# Provides: qemu-ga
+# Required-Start: udev-post
+# Required-Stop:
+# Should-Start:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 6
+# Short-Description: QEMU guest agent
+# Description: The QEMU guest agent provides a mechanism for communication
+# with a QEMU host and a host<->guest command API.
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/qemu-ga
+
+prog=qemu-ga
+bin=/usr/sbin/qemu-ga
+pidfile=${PIDFILE-/var/run/qemu-ga.pid}
+RETVAL=0
+
+wait_for_port() {
+ for i in `seq 1 5`; do
+ [ -f "$PORT" ] && return 0
+ sleep 1
+ done
+ return 1
+}
+
+start() {
+ echo -n $"Starting $prog: "
+ # Ensure the virtio_console module is loaded
+ /sbin/modprobe virtio_console
+ wait_for_port
+
+ #daemon --pidfile=${pidfile} $bin $OPTIONS
+ echo $bin -f ${pidfile} $OPTIONS >/tmp/qemu-ga.out
+ $bin -f ${pidfile} $OPTIONS
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ killproc -p ${pidfile}
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
+}
+
+restart() {
+ stop
+ start
+}
+
+condrestart() {
+ [ -e /var/lock/subsys/$prog ] && restart || :
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status -p ${pidfile} $prog
+ RETVAL=$?
+ ;;
+ restart|force-reload)
+ restart
+ ;;
+ condrestart|try-restart)
+ condrestart
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|force-reload|condrestart|try-restart|status|help}"
+ RETVAL=2
+esac
+
+exit $RETVAL
diff --git a/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.sysconfig b/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.sysconfig
new file mode 100644
index 0000000..c125a82
--- /dev/null
+++ b/guest-tools-iso/projects/qemu-ga/redhat/qemu-ga.sysconfig
@@ -0,0 +1,14 @@
+# This file configures the qemu-ga guest agent daemon
+
+# METHOD= Sets the type of channel being used. The only type currently
+# supported is virtio-serial
+METHOD="virtio-serial"
+
+# PORT= Sets the name of the channel to use. This should be a device file
+PORT="/dev/virtio-ports/org.qemu.guest_agent.0"
+
+# LOGFILE= Sets the path to the log file.
+LOGFILE="/var/log/qemu-ga.log"
+
+# Set options according to above
+OPTIONS="-m $METHOD -p $PORT -l $LOGFILE -d"
--
1.7.0.4
next prev parent reply other threads:[~2011-08-22 20:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 17:09 [Qemu-devel] [RFC] QEMU Guest Tools ISO Follow-up Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 1/5] guest tools: add iso/tarball generator for guest tools Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 2/5] guest tools: installer harness Michael Roth
2011-08-22 17:09 ` [Qemu-devel] [PATCH 3/5] guest tools: qemu-ga, debian init files Michael Roth
2011-08-22 17:09 ` Michael Roth [this message]
2011-08-22 17:09 ` [Qemu-devel] [PATCH 5/5] guest tools: installer for qemu-ga Michael Roth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314032960-23474-5-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=aliguori@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).