summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Maier <tamiko@gentoo.org>2019-07-28 14:01:38 -0500
committerMatthias Maier <tamiko@gentoo.org>2019-07-28 14:37:44 -0500
commitb3b3e1d9a13c389f17e01c78c6c1a996d08420b5 (patch)
treefc501b5618ff0d98db804a6f65f22673caed79e1 /app-emulation/spice-vdagent
parentapp-emulation/spice: drop python2.7 (diff)
downloadgentoo-b3b3e1d9a13c389f17e01c78c6c1a996d08420b5.tar.gz
gentoo-b3b3e1d9a13c389f17e01c78c6c1a996d08420b5.tar.bz2
gentoo-b3b3e1d9a13c389f17e01c78c6c1a996d08420b5.zip
app-emulation/spice-vdagent: fix init script
Closes: https://bugs.gentoo.org/670576 Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Matthias Maier <tamiko@gentoo.org>
Diffstat (limited to 'app-emulation/spice-vdagent')
-rw-r--r--app-emulation/spice-vdagent/files/spice-vdagent.initd-460
-rw-r--r--app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild2
2 files changed, 61 insertions, 1 deletions
diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.initd-4 b/app-emulation/spice-vdagent/files/spice-vdagent.initd-4
new file mode 100644
index 000000000000..ee416dacd899
--- /dev/null
+++ b/app-emulation/spice-vdagent/files/spice-vdagent.initd-4
@@ -0,0 +1,60 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ after dbus
+}
+
+PIDFILE="/var/run/spice-vdagentd/spice-vdagentd.pid"
+
+start() {
+ PORT="${PORT:-/dev/virtio-ports/com.redhat.spice.0}"
+ DEVICE="${DEVICE:-/dev/uinput}"
+
+ ebegin "Checking for required modules and devices"
+
+ if [ ! -d /sys/module/uinput ]; then
+ modprobe -q uinput
+ fi
+
+ if [ ! -e /dev/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
+
+ if [ ! -c ${DEVICE} -a -c /dev/input/uinput ]; then
+ DEVICE=/dev/input/uinput
+ fi
+
+ # recreate the directory since /var/run may reside on a ramdisk
+ mkdir -p /var/run/spice-vdagentd
+
+ # 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 \
+ -- -u "${DEVICE}" ${SPICE_VDAGENT_ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping spice VD agent daemon"
+ start-stop-daemon \
+ --stop \
+ --pidfile "${PIDFILE}"
+ eend $?
+}
diff --git a/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild b/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
index 07401dc24949..d62b552d79d0 100644
--- a/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
+++ b/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
@@ -65,6 +65,6 @@ src_install() {
keepdir /var/log/spice-vdagentd
- newinitd "${FILESDIR}/${PN}.initd-3" "${PN}"
+ newinitd "${FILESDIR}/${PN}.initd-4" "${PN}"
newconfd "${FILESDIR}/${PN}.confd-2" "${PN}"
}