Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/spice-vdagent/files/, app-emulation/spice-vdagent/
Date: Sun, 28 Jul 2019 19:39:11
Message-Id: 1564342664.b3b3e1d9a13c389f17e01c78c6c1a996d08420b5.tamiko@gentoo
1 commit: b3b3e1d9a13c389f17e01c78c6c1a996d08420b5
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jul 28 19:01:38 2019 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Sun Jul 28 19:37:44 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3b3e1d9
7
8 app-emulation/spice-vdagent: fix init script
9
10 Closes: https://bugs.gentoo.org/670576
11 Package-Manager: Portage-2.3.69, Repoman-2.3.16
12 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
13
14 .../spice-vdagent/files/spice-vdagent.initd-4 | 60 ++++++++++++++++++++++
15 .../spice-vdagent/spice-vdagent-0.19.0.ebuild | 2 +-
16 2 files changed, 61 insertions(+), 1 deletion(-)
17
18 diff --git a/app-emulation/spice-vdagent/files/spice-vdagent.initd-4 b/app-emulation/spice-vdagent/files/spice-vdagent.initd-4
19 new file mode 100644
20 index 00000000000..ee416dacd89
21 --- /dev/null
22 +++ b/app-emulation/spice-vdagent/files/spice-vdagent.initd-4
23 @@ -0,0 +1,60 @@
24 +#!/sbin/openrc-run
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +depend() {
29 + after dbus
30 +}
31 +
32 +PIDFILE="/var/run/spice-vdagentd/spice-vdagentd.pid"
33 +
34 +start() {
35 + PORT="${PORT:-/dev/virtio-ports/com.redhat.spice.0}"
36 + DEVICE="${DEVICE:-/dev/uinput}"
37 +
38 + ebegin "Checking for required modules and devices"
39 +
40 + if [ ! -d /sys/module/uinput ]; then
41 + modprobe -q uinput
42 + fi
43 +
44 + if [ ! -e /dev/uinput ]; then
45 + eerror "Module 'uinput' not loaded or not enabled in the kernel"
46 + eend 1
47 + return 1
48 + fi
49 +
50 + if [ ! -c "${PORT}" ] ; then
51 + eerror "Required virtio port does not exist. Make sure you"
52 + eerror "started the virtual machine with appropriate parameters."
53 + eend 1
54 + return 1
55 + fi
56 + eend 0
57 +
58 + if [ ! -c ${DEVICE} -a -c /dev/input/uinput ]; then
59 + DEVICE=/dev/input/uinput
60 + fi
61 +
62 + # recreate the directory since /var/run may reside on a ramdisk
63 + mkdir -p /var/run/spice-vdagentd
64 +
65 + # cleanup stalled socket
66 + rm -f /var/run/spice-vdagentd/spice-vdagent-sock
67 +
68 + ebegin "Starting spice VD agent daemon"
69 + start-stop-daemon \
70 + --start \
71 + --pidfile "${PIDFILE}" \
72 + --exec /usr/sbin/spice-vdagentd \
73 + -- -u "${DEVICE}" ${SPICE_VDAGENT_ARGS}
74 + eend $?
75 +}
76 +
77 +stop() {
78 + ebegin "Stopping spice VD agent daemon"
79 + start-stop-daemon \
80 + --stop \
81 + --pidfile "${PIDFILE}"
82 + eend $?
83 +}
84
85 diff --git a/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild b/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
86 index 07401dc2494..d62b552d79d 100644
87 --- a/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
88 +++ b/app-emulation/spice-vdagent/spice-vdagent-0.19.0.ebuild
89 @@ -65,6 +65,6 @@ src_install() {
90
91 keepdir /var/log/spice-vdagentd
92
93 - newinitd "${FILESDIR}/${PN}.initd-3" "${PN}"
94 + newinitd "${FILESDIR}/${PN}.initd-4" "${PN}"
95 newconfd "${FILESDIR}/${PN}.confd-2" "${PN}"
96 }