From: Karol Lewandowski Date: Fri, 7 Dec 2012 15:07:30 +0000 (+0100) Subject: systemd: Add unit to export dlog debug variables globally X-Git-Tag: 2.2.1_release~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28721dad62838ff45299e0d11981754f2c0761cd;p=framework%2Fsystem%2Fdlog.git systemd: Add unit to export dlog debug variables globally Change-Id: I0193f1b6b3eb90122be7456efcda63bac690b858 --- diff --git a/packaging/dlog.spec b/packaging/dlog.spec index 7f65658..5b5d4db 100755 --- a/packaging/dlog.spec +++ b/packaging/dlog.spec @@ -7,6 +7,7 @@ License: Apache License Source0: %{name}-%{version}.tar.gz Source101: packaging/dlog-main.service Source102: packaging/dlog-radio.service +Source103: packaging/tizen-debug-level.service BuildRequires: pkgconfig(systemd) Requires(post): /sbin/ldconfig Requires(post): /usr/bin/systemctl @@ -71,13 +72,16 @@ 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/basic.target.wants mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/ install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/ +install -m 0644 %SOURCE103 %{buildroot}%{_libdir}/systemd/system/ 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 ../tizen-debug-level.service %{buildroot}%{_libdir}/systemd/system/basic.target.wants/tizen-debug-level.service mkdir -p %{buildroot}/usr/share/license cp LICENSE %{buildroot}/usr/share/license/%{name} @@ -115,8 +119,10 @@ systemctl daemon-reload %{_sysconfdir}/rc.d/init.d/dlog.sh %{_sysconfdir}/rc.d/rc3.d/S05dlog %{_sysconfdir}/rc.d/rc5.d/S05dlog +%{_libdir}/systemd/system/tizen-debug-level.service %{_libdir}/systemd/system/dlog-main.service %{_libdir}/systemd/system/dlog-radio.service +%{_libdir}/systemd/system/basic.target.wants/tizen-debug-level.service %{_libdir}/systemd/system/multi-user.target.wants/dlog-main.service %{_libdir}/systemd/system/multi-user.target.wants/dlog-radio.service diff --git a/packaging/tizen-debug-level.service b/packaging/tizen-debug-level.service new file mode 100644 index 0000000..9f9f33e --- /dev/null +++ b/packaging/tizen-debug-level.service @@ -0,0 +1,14 @@ +[Unit] +Description=Set tizen debug level globally +DefaultDependencies=no +After=opt.mount +Before=basic.target +ConditionFileExists=/opt/etc/dlog/.platformloggingon + +[Service] +Type=oneshot +ExecStart=/bin/sh -c '/usr/bin/systemctl set-environment TIZEN_PLATFORMLOGGING_MODE=1 TIZEN_DLOG_LEVEL=$(cat /opt/etc/.dloglevel)' + +[Install] +WantedBy=basic.target +