From: juho Date: Wed, 24 Oct 2012 09:13:01 +0000 (+0900) Subject: Import systemd support patches from RSA X-Git-Tag: 2.2.1_release~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef89c34f93cd2cf1a4c9e30f6e38020d628081b8;p=framework%2Fsystem%2Fdlog.git Import systemd support patches from RSA - Fix post section. Remove dlog-util's post file creation, move into install section. Signed-off-by: William Douglas - add systemd unit files Signed-off-by: William Douglas - Fix initscript symlinks [ Author: Patrick McCarty ] Bastardized-by: Karol Lewandowski --- diff --git a/packaging/99-android-logger.rules b/packaging/99-android-logger.rules new file mode 100644 index 0000000..ef944c3 --- /dev/null +++ b/packaging/99-android-logger.rules @@ -0,0 +1,3 @@ +# set proper permissions on the android logger device nodes in +# /dev - make them writable by everyone, but not readable +KERNEL=="log_events|log_main|log_radio|log_system", GROUP="log", MODE="0642" \ No newline at end of file diff --git a/packaging/dlog-main.service b/packaging/dlog-main.service new file mode 100644 index 0000000..6233f2d --- /dev/null +++ b/packaging/dlog-main.service @@ -0,0 +1,11 @@ + +[Unit] +Description=Start the dlog service +DefaultDependencies=no + +[Service] +ExecStart=/usr/bin/dlogutil -v time *:W + +[Install] +WantedBy=multi-user.target + diff --git a/packaging/dlog-radio.service b/packaging/dlog-radio.service new file mode 100644 index 0000000..584760d --- /dev/null +++ b/packaging/dlog-radio.service @@ -0,0 +1,11 @@ + +[Unit] +Description=Start the dlog service +DefaultDependencies=no + +[Service] +ExecStart=/usr/bin/dlogutil -b radio -v time *:W + +[Install] +WantedBy=multi-user.target + diff --git a/packaging/dlog-system.service b/packaging/dlog-system.service new file mode 100644 index 0000000..6f63e42 --- /dev/null +++ b/packaging/dlog-system.service @@ -0,0 +1,11 @@ + +[Unit] +Description=Start the dlog service +DefaultDependencies=no + +[Service] +ExecStart=/usr/bin/dlogutil -b system -v time *:W + +[Install] +WantedBy=multi-user.target + diff --git a/packaging/dlog.changes b/packaging/dlog.changes new file mode 100644 index 0000000..4c0663d --- /dev/null +++ b/packaging/dlog.changes @@ -0,0 +1,5 @@ +* Thu Jun 28 2012 Patrick McCarty - 0.4.1 +- Fix initscript symlinks + +* Fri Jun 22 2012 William Douglas - 0.4.1 +- Add system unit files diff --git a/packaging/dlog.spec b/packaging/dlog.spec index 0f9a51c..3cf01ca 100644 --- a/packaging/dlog.spec +++ b/packaging/dlog.spec @@ -1,13 +1,22 @@ +#sbs-git:slp/pkgs/d/dlog dlog 0.4.0 f2a67c71d044de4757f7eef9759c7f99d527462f Name: dlog Summary: Logging service Version: 0.4.0 Release: 5.1 Group: TO_BE/FILLED_IN -License: Apache-2.0 +License: TO BE FILLED IN Source0: %{name}-%{version}.tar.gz +Source1: packaging/99-android-logger.rules +Source101: packaging/dlog-main.service +Source102: packaging/dlog-radio.service +Source103: packaging/dlog-system.service + 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 %description dlog API library @@ -32,6 +41,7 @@ dlog API library Summary: print log data to the screen Group: Development/Libraries Requires: lib%{name} = %{version}-%{release} +Requires(post): /bin/rm, /bin/ln %description -n dlogutil utilities for print log data @@ -51,16 +61,47 @@ make %{?jobs:-j%jobs} %install rm -rf %{buildroot} %make_install + +mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d +mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc5.d +rm -f %{buildroot}/%{_sysconfdir}/etc/rc.d/rc3.d/S05dlog +rm -f %{buildroot}/%{_sysconfdir}/etc/rc.d/rc5.d/S05dlog +ln -s ../init.d/dlog.sh %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S05dlog +ln -s ../init.d/dlog.sh %{buildroot}/%{_sysconfdir}/rc.d/rc5.d/S05dlog + +mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants +mkdir -p %{buildroot}%{_libdir}/udev/rules.d + +install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/ +install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/ +install -m 0644 %SOURCE103 %{buildroot}%{_libdir}/systemd/system/ +install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/udev/rules.d/ + +ln -s ../dlog-main.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service +ln -s ../dlog-radio.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service +ln -s ../dlog-system.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/dlog-system.service + mkdir -p %{buildroot}/opt/etc/ cp %{_builddir}/%{name}-%{version}/.debuglevel %{buildroot}/opt/etc/.debuglevel + +%preun -n dlogutil +if [ $1 == 0 ]; then + systemctl stop dlog-main.service + systemctl stop dlog-radio.service + systemctl stop dlog-system.service +fi + %post -n dlogutil -#Add boot sequence script -mkdir -p /etc/rc.d/rc5.d -rm -f /etc/rc.d/rc3.d/S47dlog /etc/rc.d/rc5.d/S05dlog -ln -s /etc/rc.d/init.d/dlog.sh /etc/rc.d/rc3.d/S47dlog -ln -s /etc/rc.d/init.d/dlog.sh /etc/rc.d/rc5.d/S05dlog +systemctl daemon-reload +if [ $1 == 1 ]; then + systemctl restart dlog-main.service + systemctl restart dlog-radio.service + systemctl restart dlog-system.service +fi +%postun -n dlogutil +systemctl daemon-reload %post -n libdlog chmod +x /opt/etc/.debuglevel @@ -75,6 +116,15 @@ ln -s /opt/etc/.debuglevel /etc/profile.d/dlevel.sh %manifest dlogutil.manifest %{_bindir}/dlogutil %{_sysconfdir}/rc.d/init.d/dlog.sh +%{_sysconfdir}/rc.d/rc3.d/S05dlog +%{_sysconfdir}/rc.d/rc5.d/S05dlog +%{_libdir}/systemd/system/dlog-main.service +%{_libdir}/systemd/system/dlog-radio.service +%{_libdir}/systemd/system/dlog-system.service +%{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service +%{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service +%{_libdir}/systemd/system/multi-user.target.wants/dlog-system.service +%{_libdir}/udev/rules.d/99-android-logger.rules %files -n libdlog %doc LICENSE