summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Lynch <rusty.lynch@intel.com>2012-09-17 13:16:35 -0700
committerRusty Lynch <rusty.lynch@intel.com>2012-09-17 13:17:49 -0700
commita2d0d397c8bf3e0f20fe07d254f56161045f8725 (patch)
tree376690d68c39946b9339e2e954df2e3b5ff8fbff
parent05342f00942c79b674e04bb1a7b998a47f976287 (diff)
downloadremotecontrol-a2d0d397c8bf3e0f20fe07d254f56161045f8725.tar.gz
remotecontrol-a2d0d397c8bf3e0f20fe07d254f56161045f8725.tar.bz2
remotecontrol-a2d0d397c8bf3e0f20fe07d254f56161045f8725.zip
Adding systemd support to automatically start the servicesubmit/trunk/20120917.201852accepted/trunk/20120917.204541
-rw-r--r--packaging/remotecontrol.service14
-rw-r--r--packaging/remotecontrol.spec7
2 files changed, 21 insertions, 0 deletions
diff --git a/packaging/remotecontrol.service b/packaging/remotecontrol.service
new file mode 100644
index 0000000..a539e40
--- /dev/null
+++ b/packaging/remotecontrol.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=RemoteControl Daemon
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/start-remoteserver
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=always
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/packaging/remotecontrol.spec b/packaging/remotecontrol.spec
index f197a22..693773f 100644
--- a/packaging/remotecontrol.spec
+++ b/packaging/remotecontrol.spec
@@ -6,6 +6,7 @@ License: Apache-2.0
Url: https://github.com/otcshare/remotecontrol
Summary: Remote Control App
Source: remotecontrol-%{version}.tar.bz2
+Source1: remotecontrol.service
BuildRequires: pkgconfig(python)
BuildRequires: python-setuptools
Requires: python
@@ -32,8 +33,14 @@ python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+mkdir -p $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants
+install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/%{_libdir}/systemd/system/
+ln -sf ../remotecontrol.service $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants/remotecontrol.service
+
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/*
%{_bindir}/start-remoteserver
+%{_libdir}/systemd/system/remotecontrol.service
+%{_libdir}/systemd/system/graphical.target.wants/remotecontrol.service \ No newline at end of file