aboutsummaryrefslogtreecommitdiffstats
path: root/testing/spice-vdagent/spice-vdagentd.initd
diff options
context:
space:
mode:
authorStuart Cardall <developer@it-offshore.co.uk>2015-04-20 11:14:34 +0000
committerLeonardo Arena <rnalrd@alpinelinux.org>2015-04-27 07:15:14 +0000
commit0eecc344f01e57415f31798cf8c27f7f0796ad9b (patch)
treef9bdb3bd431c6feddeea4d30ccd16162663218ef /testing/spice-vdagent/spice-vdagentd.initd
parent3bbd14339e193fb2e619868b96463ad2eb6cc6dd (diff)
downloadaports-0eecc344f01e57415f31798cf8c27f7f0796ad9b.tar.bz2
aports-0eecc344f01e57415f31798cf8c27f7f0796ad9b.tar.xz
testing/spice-vdagent: fix copy / paste functionality
This patch adds an init script for copy & paste functionality between the guest & host. Run 'rc-service spice-vdagentd info' for details on the settings for libvirt. By default this runs with a single session possible. For multiple sessions remove '-X' to disable consolekit from the init script & install slim or lxdm. Tested on 32 & 64 bit KVM - but should also work on XEN / LXC run by libvirt. Signed-off-by: Leonardo Arena <rnalrd@alpinelinux.org>
Diffstat (limited to 'testing/spice-vdagent/spice-vdagentd.initd')
-rw-r--r--testing/spice-vdagent/spice-vdagentd.initd97
1 files changed, 97 insertions, 0 deletions
diff --git a/testing/spice-vdagent/spice-vdagentd.initd b/testing/spice-vdagent/spice-vdagentd.initd
new file mode 100644
index 0000000000..904908d9bd
--- /dev/null
+++ b/testing/spice-vdagent/spice-vdagentd.initd
@@ -0,0 +1,97 @@
+#!/sbin/runscript
+
+# This file is part of spice-vdagent
+# by Stuart Cardall <developer@it-offshore.co.uk>
+
+sockfile="/var/run/spice-vdagentd/spice-vdagent-sock"
+pidfile="/var/run/spice-vdagentd/spice-vdagentd.pid"
+command="/usr/sbin/spice-vdagentd"
+command_args="-X"
+msgfile=/tmp/spice-vdagent.msg
+extra_commands="info"
+
+MODULES="uinput"
+
+depend() {
+ need net
+ need logger
+}
+
+start_pre() {
+ # make sure dir for pidfile exists. /var/run is tmpfs...
+ checkpath --directory ${pidfile%/*}
+ # load userspace input driver for copy & paste support
+ ebegin "Loading uinput kernel module for ${SVCNAME}"
+ for mod in $MODULES; do
+ modprobe -q $mod
+ done
+ eend $?
+ rm -f $sockfile
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start $command --pidfile $pidfile -- $command_args
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ eend $? "Failed to stop ${SVCNAME}"
+ ebegin "Unloading uinput kernel module for ${SVCNAME}"
+ for mod in $MODULES; do
+ rmmod $mod
+ done
+ eend $?
+ rm -f $sockfile
+}
+
+info() {
+ cat > $msgfile <<EOF
+By default the daemon is run with $command_args="-X" to disable consolekit
+support & allow a single agent session only. Run without '-X' & install lxdm
+or slim for muliple sessions.
+
+------------------------------------------------------------------------------
+Settings for libvirt:
+------------------------------------------------------------------------------
+<channel type='spicevmc'>
+ <target type='virtio' name='com.redhat.spice.0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='1'/>
+</channel>
+ <input type='tablet' bus='usb'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+<graphics type='spice' autoport='yes' listen='127.0.0.1'>
+ <listen type='address' address='127.0.0.1'/>
+ <channel name='main' mode='insecure'/>
+ <channel name='record' mode='insecure'/>
+ <image compression='auto_glz'/>
+ <jpeg compression='auto'/>
+ <zlib compression='auto'/>
+ <playback compression='on'/>
+ <streaming mode='filter'/>
+ <mouse mode='client'/>
+ <clipboard copypaste='yes'/>
+ <filetransfer enable='yes'/>
+</graphics>
+<video>
+ <model type='qxl' ram='65536' vram='9216' heads='1'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+</video>
+
+------------------------------------------------------------------------------
+Settings for /etc/X11/xorg.conf: <install xf86-video-qxl>
+------------------------------------------------------------------------------
+Section "Device"
+ Identifier "Videocard0"
+ Driver "qxl"
+ Option "EnableSurfaces" "0"
+EndSection
+EOF
+
+cat $msgfile
+rm -f $msgfile
+}
+