From 4f5e25ba1dbe3bbfa96d8f63118cc394f3d8f3ed Mon Sep 17 00:00:00 2001 From: Wook Song Date: Tue, 20 Jun 2017 15:33:29 +0900 Subject: [PATCH] pass-hal: tm2: packaging: Restart daemon after install/uninstall 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 --- packaging/pass-hal-tm2.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packaging/pass-hal-tm2.spec b/packaging/pass-hal-tm2.spec index 374a548..3dbec3e 100644 --- a/packaging/pass-hal-tm2.spec +++ b/packaging/pass-hal-tm2.spec @@ -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 -- 2.7.4