From 2e2f161b5d28b9d337bdc020bcff691441208844 Mon Sep 17 00:00:00 2001 From: sungmin ha Date: Fri, 24 Oct 2014 14:20:24 +0900 Subject: [PATCH] modified install path for auto start in emulator Change-Id: I378f83e3137b903164d68bff57648bb6bc8fc384 Signed-off-by: sungmin ha --- README | 2 +- data/rsyslog.d/spice-vdagentd.conf | 2 +- data/spice-vdagent | 6 +++--- data/spice-vdagent.service | 1 - data/spice-vdagentd | 6 +++--- data/spice-vdagentd.service | 4 ++-- data/tmpfiles.d/spice-vdagentd.conf | 2 +- packaging/spice-vdagent.spec | 22 +--------------------- src/vdagentd-proto.h | 2 +- src/vdagentd-xorg-conf.c | 4 ++-- src/vdagentd.c | 2 +- 11 files changed, 16 insertions(+), 37 deletions(-) diff --git a/README b/README index 502e559..577db36 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ Features: Then connect to the vm with the multiple monitor client which you want to use it with using: "spicec --full-screen=auto-config" (or the user portal equivalent). At this point the agent will write out a: - /opt/var/run/spice-vdagentd/xorg.conf.spice file. With all the necessary magic + /tmp/spice-vdagentd/xorg.conf.spice file. With all the necessary magic to get Xinerama working. Move this file to /etc/X11/xorg.conf, then kill Xorg so that it will get restarted and you should be good to go. * Limited support for setups with multiple Screens (multiple qxl devices each diff --git a/data/rsyslog.d/spice-vdagentd.conf b/data/rsyslog.d/spice-vdagentd.conf index caaf31f..088ecd8 100644 --- a/data/rsyslog.d/spice-vdagentd.conf +++ b/data/rsyslog.d/spice-vdagentd.conf @@ -1,4 +1,4 @@ # A template to for higher precision timestamps + severity logging $template SpiceTmpl,"%TIMESTAMP%.%TIMESTAMP:::date-subseconds% %syslogtag% %syslogseverity-text%:%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n" -:programname, startswith, "spice-vdagent" /opt/var/run/log/spice-vdagent.log;SpiceTmpl +:programname, startswith, "spice-vdagent" /tmp/log/spice-vdagent.log;SpiceTmpl diff --git a/data/spice-vdagent b/data/spice-vdagent index dfb2574..c90a993 100755 --- a/data/spice-vdagent +++ b/data/spice-vdagent @@ -27,18 +27,18 @@ exec="/usr/sbin/spice-vdagentd" prog="spice-vdagentd" port="/dev/virtio-ports/com.redhat.spice.0" -pid="/opt/var/run/spice-vdagentd/spice-vdagentd.pid" +pid="/tmp/spice-vdagentd/spice-vdagentd.pid" [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog -lockfile=/opt/var/run/lock/subsys/$prog +lockfile=/tmp/spice-vdagentd/lock/subsys/$prog start() { [ -x $exec ] || exit 5 [ -c $port ] || exit 0 modprobe uinput > /dev/null 2>&1 # In case the previous running vdagentd crashed - rm -f /opt/var/run/spice-vdagentd/spice-vdagent-sock + rm -f /tmp/spice-vdagentd/spice-vdagent-sock echo -n $"Starting $prog: " daemon --pidfile $pid $exec $SPICE_VDAGENTD_EXTRA_ARGS diff --git a/data/spice-vdagent.service b/data/spice-vdagent.service index 6def108..47d5d70 100644 --- a/data/spice-vdagent.service +++ b/data/spice-vdagent.service @@ -1,6 +1,5 @@ [Unit] Description=Agent for Spice guests -After=xorg.target e17.service [Service] Type=forking diff --git a/data/spice-vdagentd b/data/spice-vdagentd index ab8f8f9..4072862 100755 --- a/data/spice-vdagentd +++ b/data/spice-vdagentd @@ -27,18 +27,18 @@ exec="/usr/sbin/spice-vdagentd" prog="spice-vdagentd" port="/dev/virtio-ports/com.redhat.spice.0" -pid="/opt/var/run/spice-vdagentd/spice-vdagentd.pid" +pid="/tmp/spice-vdagentd/spice-vdagentd.pid" [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog -lockfile=/opt/var/run/lock/subsys/$prog +lockfile=/tmp/spice-vdagentd/lock/subsys/$prog start() { [ -x $exec ] || exit 5 [ -c $port ] || exit 0 modprobe uinput > /dev/null 2>&1 # In case the previous running vdagentd crashed - rm -f /opt/var/run/spice-vdagentd/spice-vdagent-sock + rm -f /tmp/spice-vdagentd/spice-vdagent-sock echo -n $"Starting $prog: " daemon --pidfile $pid $exec $SPICE_VDAGENTD_EXTRA_ARGS retval=$? diff --git a/data/spice-vdagentd.service b/data/spice-vdagentd.service index 36e1075..91ec247 100644 --- a/data/spice-vdagentd.service +++ b/data/spice-vdagentd.service @@ -8,9 +8,9 @@ After=dbus.target [Service] Type=forking EnvironmentFile=-/etc/sysconfig/spice-vdagentd -ExecStartPre=/bin/rm -f /opt/var/run/spice-vdagentd/spice-vdagent-sock +ExecStartPre=/bin/rm -f /tmp/spice-vdagentd/spice-vdagent-sock ExecStart=/usr/sbin/spice-vdagentd $SPICE_VDAGENTD_EXTRA_ARGS; -PIDFile=/opt/var/run/spice-vdagentd/spice-vdagentd.pid +PIDFile=/tmp/spice-vdagentd/spice-vdagentd.pid PrivateTmp=true [Install] diff --git a/data/tmpfiles.d/spice-vdagentd.conf b/data/tmpfiles.d/spice-vdagentd.conf index 462cd1f..b558cc6 100644 --- a/data/tmpfiles.d/spice-vdagentd.conf +++ b/data/tmpfiles.d/spice-vdagentd.conf @@ -1,2 +1,2 @@ # spice-vdagentd needs this and does not create it itself -d /opt/var/run/spice-vdagentd 0755 root root - +d /tmp/spice-vdagentd 0755 root root - diff --git a/packaging/spice-vdagent.spec b/packaging/spice-vdagent.spec index adb7978..0c6cef1 100644 --- a/packaging/spice-vdagent.spec +++ b/packaging/spice-vdagent.spec @@ -1,5 +1,5 @@ Name: spice-vdagent -Version: 0.15.0 +Version: 0.15.1 Release: 1 Summary: This is used for spice input communication License: GPL-3.0 @@ -24,21 +24,6 @@ BuildRequires: spice-protocol make %install -rm -rf %{buildroot} - -if [ ! -d %{buildroot}/usr/lib/systemd/system/emulator.target.wants ]; then - mkdir -p %{buildroot}/usr/lib/systemd/system/emulator.target.wants -fi -cp data/spice-vdagentd.service %{buildroot}/usr/lib/systemd/system/. -ln -s ../spice-vdagentd.service %{buildroot}/usr/lib/systemd/system/emulator.target.wants/spice-vdagentd.service - -if [ ! -d %{buildroot}/usr/lib/systemd/user/core-efl.target.wants ]; then - mkdir -p %{buildroot}/usr/lib/systemd/user/core-efl.target.wants -fi -cp data/spice-vdagent.service %{buildroot}/usr/lib/systemd/user/. -ln -s ../spice-vdagent.service %{buildroot}/usr/lib/systemd/user/core-efl.target.wants/spice-vdagent.service - -%make_install %clean make clean @@ -49,16 +34,11 @@ rm -rf Makefile rm -rf install_manifest.txt %post -mkdir -p /opt/var/run/spice-vdagentd %postun %files %defattr(-,root,root,-) -/usr/lib/systemd/user/spice-vdagent.service -/usr/lib/systemd/system/spice-vdagentd.service -/usr/lib/systemd/user/core-efl.target.wants/spice-vdagent.service -/usr/lib/systemd/system/emulator.target.wants/spice-vdagentd.service /usr/bin/spice-vdagent /usr/etc/rsyslog.d/spice-vdagentd.conf /usr/etc/xdg/autostart/spice-vdagent.desktop diff --git a/src/vdagentd-proto.h b/src/vdagentd-proto.h index c0fd7d4..129e0cf 100644 --- a/src/vdagentd-proto.h +++ b/src/vdagentd-proto.h @@ -27,7 +27,7 @@ #ifndef __VDAGENTD_PROTO_H #define __VDAGENTD_PROTO_H -#define VDAGENTD_SOCKET "/opt/var/run/spice-vdagentd/spice-vdagent-sock" +#define VDAGENTD_SOCKET "/tmp/spice-vdagentd/spice-vdagent-sock" enum { VDAGENTD_GUEST_XORG_RESOLUTION, /* client -> daemon, arg1: overall width, diff --git a/src/vdagentd-xorg-conf.c b/src/vdagentd-xorg-conf.c index 561e6ce..07aa4f3 100644 --- a/src/vdagentd-xorg-conf.c +++ b/src/vdagentd-xorg-conf.c @@ -60,8 +60,8 @@ void vdagentd_write_xorg_conf(VDAgentMonitorsConfig *monitor_conf) .subvendor_id = PCI_MATCH_ANY, .subdevice_id = PCI_MATCH_ANY, }; - const char *xorg_conf = "/opt/var/run/spice-vdagentd/xorg.conf.spice"; - const char *xorg_conf_old = "/opt/var/run/spice-vdagentd/xorg.conf.spice.old"; + const char *xorg_conf = "/tmp/spice-vdagentd/xorg.conf.spice"; + const char *xorg_conf_old = "/tmp/spice-vdagentd/xorg.conf.spice.old"; r = rename(xorg_conf, xorg_conf_old); if (r && errno != ENOENT) { diff --git a/src/vdagentd.c b/src/vdagentd.c index e47c932..f387d03 100644 --- a/src/vdagentd.c +++ b/src/vdagentd.c @@ -57,7 +57,7 @@ struct agent_data { }; /* variables */ -static const char *pidfilename = "/opt/var/run/spice-vdagentd/spice-vdagentd.pid"; +static const char *pidfilename = "/tmp/spice-vdagentd/spice-vdagentd.pid"; static const char *portdev = "/dev/virtio-ports/com.redhat.spice.0"; static const char *vdagentd_socket = VDAGENTD_SOCKET; static const char *uinput_device = "/dev/uinput"; -- 2.7.4