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>
%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