From: Krisztian Litkey Date: Wed, 26 Jun 2013 18:27:24 +0000 (+0300) Subject: packaging: changed to start by systemd. X-Git-Tag: accepted/tizen/ivi/20150112.012920~360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab148349baf8e5b50de36702c4dbf3a9dfd74424;p=profile%2Fivi%2Fmurphy.git packaging: changed to start by systemd. --- diff --git a/packaging.in/murphy.spec.in b/packaging.in/murphy.spec.in index 5692d50..777b080 100644 --- a/packaging.in/murphy.spec.in +++ b/packaging.in/murphy.spec.in @@ -19,6 +19,9 @@ %{!?_with_websockets:%{!?_without_websockets:%define _with_websockets 1}} %{!?_with_squashpkg:%{!?_without_squashpkg:%define _with_squashpkg 1}} +# TODO: take care of /lib vs /lib64... +%define systemddir /lib/systemd + Summary: Murphy policy framework Name: murphy Version: @VERSION@ @@ -346,9 +349,9 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb cp packaging.in/amb-config.lua \ $RPM_BUILD_ROOT%{_sysconfdir}/murphy/plugins/amb/config.lua -mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d -cp packaging.in/murphyd.init $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/murphyd -chmod a+x $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/murphyd +# Copy the systemd service file in place. +mkdir -p $RPM_BUILD_ROOT%{systemddir}/system +cp packaging.in/murphyd.service $RPM_BUILD_ROOT%{systemddir}/system %if %{?_with_dbus:1}%{!?_with_dbus:0} mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d @@ -359,7 +362,7 @@ cp packaging.in/org.Murphy.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/or rm -rf $RPM_BUILD_ROOT %post -ln -sf %{_sysconfdir}/rc.d/init.d/murphyd %{_sysconfdir}/rc.d/rc3.d/S21murphyd +systemctl enable murphyd.service %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1} %post core @@ -368,7 +371,7 @@ ldconfig %postun if [ "$1" = "0" ]; then - rm -f %{_sysconfdir}/rc.d/rc3.d/S21murphyd + systemctl disable murphyd.service fi %if %{?_with_squashpkg:0}%{!?_with_squashpkg:1} @@ -384,7 +387,7 @@ ldconfig %defattr(-,root,root,-) %{_bindir}/murphyd %{_sysconfdir}/murphy -%{_sysconfdir}/rc.d/init.d/murphyd +%{systemddir}/system/murphyd.service %if %{?_with_audiosession:1}%{!?_with_audiosession:0} %{_sbindir}/asm-bridge %endif diff --git a/packaging.in/murphyd.service b/packaging.in/murphyd.service new file mode 100644 index 0000000..87921d6 --- /dev/null +++ b/packaging.in/murphyd.service @@ -0,0 +1,11 @@ +[Unit] +Description=Murphy Resource Policy Daemon + +[Service] +Type=simple +ExecStartPre=/bin/mkdir -p /tmp/murphy /var/run/murphy/processes +ExecStart=/usr/bin/murphyd -t dlog -vvv -f +KillSignal=SIGKILL + +[Install] +WantedBy=multi-user.target