pass-hal: tm2: Change the way to restart daemon after install/uninstall 44/145544/2 accepted/tizen/unified/20170824.172543 submit/tizen/20170824.064003
authorWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:29:35 +0000 (10:29 +0900)
committerWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:32:43 +0000 (10:32 +0900)
This patch simply changes the way to restart the pass daemon after
installing or uninstalling this package. 'awk' is no longer needed. Note
that the option 'try-restart' of systemctl is to restart one or more
units (in this context, means the pass daemon) if active.

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

index ba28c02..f6f0200 100644 (file)
@@ -13,7 +13,9 @@ Source1:    %{name}.manifest
 ExclusiveArch: %{arm} aarch64
 
 Requires(post): /sbin/ldconfig
+Requires(post): /bin/systemctl
 Requires(postun): /sbin/ldconfig
+Requires(postun): /bin/systemctl
 Requires: pass >= 0.0.1
 Requires: pass-hal-standard >= 0.0.1
 BuildRequires:  cmake
@@ -38,13 +40,13 @@ rm -rf %{buildroot}
 %post
 /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
 
 %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