pass-hal: standard: Change the way to restart daemon after (un)install 43/145543/1 accepted/tizen/unified/20170824.172534 submit/tizen/20170824.064003
authorWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:18:32 +0000 (10:18 +0900)
committerWook Song <wook16.song@samsung.com>
Wed, 23 Aug 2017 01:31:53 +0000 (10:31 +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, the pass daemon) if active.

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

index a840107..0b2ec9e 100644 (file)
@@ -11,7 +11,9 @@ Source0:    %{name}-%{version}.tar.gz
 Source1:    %{name}.manifest
 
 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)
@@ -39,13 +41,13 @@ rm -rf %{buildroot}
 /sbin/ldconfig
 systemd-tmpfiles /usr/lib/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