pass-hal: tm1: Change the way to restart daemon after install/uninstall 39/145539/1 accepted/tizen/unified/20170824.172541 submit/tizen/20170824.064003
authorWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:04:09 +0000 (10:04 +0900)
committerWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:14:55 +0000 (10:14 +0900)
Since the binary of 'awk', which is exploited to check the state of the
pass daemon itself, is not included in the Tizen image for the headless
devices, this patch changes the way to restart the PASS daemon itself
after installing or uninstalling this package.

Change-Id: Id830ee185a1fbb5f9d3f8e3fe34b7627345d1d4e
Signed-off-by: Wook Song <wook16.song@samsung.com>
packaging/pass-hal-tm1.spec

index 0348bc17aaf9fbd55284d4f5f79b72aef652f3e3..8e61f41ef875b3164352208b8c2a65860efd183f 100644 (file)
@@ -13,7 +13,9 @@ Source1:    %{name}.manifest
 ExclusiveArch: %{arm}
 
 Requires(post): /sbin/ldconfig
+Requires(post): /bin/systemctl
 Requires(postun): /sbin/ldconfig
+Requires(postun): /bin/systemctl
 Requires: pass >= 0.0.1
 BuildRequires:  cmake
 BuildRequires:  pkgconfig(dlog)
@@ -40,13 +42,13 @@ rm -rf %{buildroot}
 /sbin/ldconfig
 systemd-tmpfiles %{_libdir}/tmpfiles.d/pass-hal.conf --create
 if [ -f %{_unitdir}/pass.service ]; then
-       systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
+       systemctl try-restart pass.service
 fi
 
 %postun
 /sbin/ldconfig
 if [ -f %{_unitdir}/pass.service ]; then
-       systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
+       systemctl try-restart pass.service
 fi
 
 %files