pass-hal: tm2: packaging: Restart daemon after install/uninstall 34/134834/6
authorWook Song <wook16.song@samsung.com>
Tue, 20 Jun 2017 06:33:29 +0000 (15:33 +0900)
committerWook Song <wook16.song@samsung.com>
Thu, 22 Jun 2017 09:43:55 +0000 (18:43 +0900)
This patch adds bits of code to %post and %postun sections so that the
daemon is restarted when the package is installed/uninstalled. Note that
the daemon is only restarted in the case of that the daemon is running
before the hal package is installed/uninstalled.

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

index 374a548..3dbec3e 100644 (file)
@@ -39,8 +39,15 @@ rm -rf %{buildroot}
 %post
 /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")}'
+fi
 
-%postun -p /sbin/ldconfig
+%postun
+/sbin/ldconfig
+if [ -f %{_unitdir}/pass.service ]; then
+       systemctl | grep pass.service  | awk '{if ($3 == "active" && $4 == "running") system("systemctl restart pass.service")}'
+fi
 
 %files
 %manifest %{name}.manifest