summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2011-05-11 09:02:31 +0000
committerTiziano Müller <dev-zero@gentoo.org>2011-05-11 09:02:31 +0000
commit41d45617d20cc440881c067c8f6b2b37ee9892c4 (patch)
tree5595fe81d1f06127451939bb3a1b6ca25ec67fcd /app-emulation/spice-vdagent/files
parentClean up old revisions. (diff)
downloadgentoo-2-41d45617d20cc440881c067c8f6b2b37ee9892c4.tar.gz
gentoo-2-41d45617d20cc440881c067c8f6b2b37ee9892c4.tar.bz2
gentoo-2-41d45617d20cc440881c067c8f6b2b37ee9892c4.zip
Initial commit, ebuild written by me.
(Portage version: 2.1.9.46/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/spice-vdagent/files')
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.confd7
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.initd47
2 files changed, 54 insertions, 0 deletions
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.confd b/app-emulation/spice-vdagent/files/spice-vdagent.confd
new file mode 100644
index 000000000000..326f894424d7
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.confd
@@ -0,0 +1,7 @@
+
+# The virtual communication port provided by the hypervisor/vm
+PORT="/dev/virtio-ports/com.redhat.spice.0"
+
+# extra arguments for spice-vdagentd
+SPICE_VDAGENT_ARGS=""
+
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.initd b/app-emulation/spice-vdagent/files/spice-vdagent.initd
new file mode 100644
index 000000000000..3d8f71ab00d9
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.initd
@@ -0,0 +1,47 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/spice-vdagent/files/spice-vdagent.initd,v 1.1 2011/05/11 09:02:31 dev-zero Exp $
+
+depend() {
+ after dbus
+}
+
+PIDFILE="/var/run/spice-vdagentd/spice-vdagentd.pid"
+
+start() {
+ ebegin "Checking for required modules and devices"
+
+ if [[ ! -d /sys/module/uinput ]] ; then
+ eerror "Module 'uinput' not loaded or not enabled in the kernel"
+ eend 1
+ return 1
+ fi
+
+ if [[ ! -c "${PORT}" ]] ; then
+ eerror "Required virtio port does not exist. Make sure you"
+ eerror "started the virtual machine with appropriate parameters."
+ eend 1
+ return 1
+ fi
+ eend 0
+
+ # cleanup stalled socket
+ rm -f /var/run/spice-vdagentd/spice-vdagent-sock
+
+ ebegin "Starting spice VD agent daemon"
+ start-stop-daemon
+ --start \
+ --pidfile "${PIDFILE}" \
+ --exec /usr/sbin/spice-vdagentd \
+ -- ${SPICE_VDAGENT_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spice VD agent daemon"
+ start-stop-daemon
+ --stop \
+ --pidfile "${PIDFILE}"
+ eend $?
+}