Manage ode service during installation/uninstallation 71/126671/2
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 24 Apr 2017 14:27:27 +0000 (16:27 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Thu, 4 May 2017 10:21:46 +0000 (12:21 +0200)
Change-Id: I36b352d1095ad74f16ded4476a2604b53441a07f

packaging/ode.spec

index 2ff68c3..3a65e8a 100755 (executable)
@@ -61,6 +61,22 @@ ln -s ../ode.service %{buildroot}/%{_unitdir}/multi-user.target.wants/ode.servic
 %clean
 rm -rf %{buildroot}
 
+%post
+systemctl daemon-reload
+if [ $1 = 1 ]; then
+    # installation
+    systemctl start ode.service
+elif [ $1 = 2 ]; then
+    # update
+    systemctl restart ode.service
+fi
+
+%preun
+if [ $1 = 0 ]; then
+    # unistall
+    systemctl stop ode.service
+fi
+
 %postun
 
 ## ODE Client Package ########################################################