summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Douglas <william.douglas@intel.com>2012-06-21 21:22:43 (GMT)
committerWilliam Douglas <william.douglas@intel.com>2012-06-22 20:53:39 (GMT)
commitf9891c8ce86e1d5293e33247fd56065d9a66b42d (patch)
treebe83355dd39e9f22144df8fe01c1610622069881
parent2969d836abbeea777fd896550f56a39239ad246d (diff)
downloadaudio-session-manager-f9891c8ce86e1d5293e33247fd56065d9a66b42d.zip
audio-session-manager-f9891c8ce86e1d5293e33247fd56065d9a66b42d.tar.gz
audio-session-manager-f9891c8ce86e1d5293e33247fd56065d9a66b42d.tar.bz2
add system unit file
Signed-off-by: William Douglas <william.douglas@intel.com>
-rw-r--r--packaging/audio-session-manager.changes2
-rw-r--r--packaging/audio-session-manager.service15
-rw-r--r--packaging/audio-session-manager.spec24
3 files changed, 39 insertions, 2 deletions
diff --git a/packaging/audio-session-manager.changes b/packaging/audio-session-manager.changes
new file mode 100644
index 0000000..d940b9b
--- /dev/null
+++ b/packaging/audio-session-manager.changes
@@ -0,0 +1,2 @@
+* Thu Jun 21 2012 William Douglas <william.douglas@intel.com> - 0.1.19
+- Add systemd unit files
diff --git a/packaging/audio-session-manager.service b/packaging/audio-session-manager.service
new file mode 100644
index 0000000..a90b06a
--- /dev/null
+++ b/packaging/audio-session-manager.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Start the audio manager
+
+[Service]
+ExecStart=/usr/bin/audio-session-mgr-server
+Restart=restart-always
+RestartSec=3
+
+OOMScoreAdjust=-100
+IOSchedulingClass=realtime
+IOSchedulingPriority=1
+CPUSchedulingPriority=90
+
+[Install]
+WantedBy=multi-user.target
diff --git a/packaging/audio-session-manager.spec b/packaging/audio-session-manager.spec
index 8528bf9..fff4b71 100644
--- a/packaging/audio-session-manager.spec
+++ b/packaging/audio-session-manager.spec
@@ -2,13 +2,19 @@ Name: audio-session-manager
Summary: Audioxi Session Manager
Version: 0.1.19
Release: 1
-Group: TO_BE/FILLED_IN
+Group: System/Main
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source101: audio-session-manager.service
Source1001: packaging/audio-session-manager.manifest
+
Requires(post): /sbin/ldconfig
+Requires(post): /usr/bin/systemctl
Requires(post): /usr/bin/vconftool
Requires(postun): /sbin/ldconfig
+Requires(postun): /usr/bin/systemctl
+Requires(preun): /usr/bin/systemctl
+
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(mm-log)
BuildRequires: pkgconfig(sysman)
@@ -62,14 +68,26 @@ mkdir -p %{buildroot}/etc/rc.d/rc4.d
ln -s ../etc/rc.d/init.d/audiosessionmanager %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S30audiosessionmanager
ln -s ../etc/rc.d/init.d/audiosessionmanager %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S30audiosessionmanager
+mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
+install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/
+ln -s ../audio-session-manager.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/audio-session-manager.service
+
+
+%preun
+if [ $1 == 0 ]; then
+ systemctl stop audio-session-manager.service
+fi
%post
/sbin/ldconfig
-
+if [ $1 == 1 ]; then
+ systemctl restart audio-session-manager.service
+fi
vconftool set -t int memory/Sound/SoundStatus "0" -i
%postun
/sbin/ldconfig
+systemctl daemon-reload
%files
@@ -79,6 +97,8 @@ vconftool set -t int memory/Sound/SoundStatus "0" -i
%{_sysconfdir}/rc.d/rc4.d/S30audiosessionmanager
%{_bindir}/audio-session-mgr-server
%{_libdir}/libaudio-session-mgr.so.*
+%{_libdir}/systemd/system/audio-session-manager.service
+%{_libdir}/systemd/system/multi-user.target.wants/audio-session-manager.service
%files devel
%manifest audio-session-manager.manifest