Clean up csr db before start service 42/75642/3
authorKyungwook Tak <k.tak@samsung.com>
Tue, 21 Jun 2016 00:58:42 +0000 (09:58 +0900)
committersangwan kwon <sangwan.kwon@samsung.com>
Tue, 21 Jun 2016 02:51:08 +0000 (19:51 -0700)
Change-Id: Ie69c009af831a18bd5de21c96faae1e8e014ee7a
Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
packaging/csr-framework.spec

index c7088b1..1ba85e2 100644 (file)
@@ -216,34 +216,27 @@ mkdir -p %{buildroot}%{engine_dir}
 mkdir -p %{buildroot}%{engine_rw_working_dir}
 
 %post
+rm -f %{rw_db_dir}/.%{service_name}.db*
+
 systemctl daemon-reload
-if [ $1 = 1 ]; then
-    systemctl start %{service_name}-cs.socket
-    systemctl start %{service_name}-wp.socket
-    systemctl start %{service_name}-admin.socket
-    systemctl start %{service_name}-popup.socket
-    systemctl start %{service_name}.service
-fi
 
-if [ $1 = 2 ]; then
-    systemctl restart %{service_name}-cs.socket
-    systemctl restart %{service_name}-wp.socket
-    systemctl restart %{service_name}-admin.socket
-    systemctl restart %{service_name}-popup.socket
-    systemctl restart %{service_name}.service
-fi
+systemctl start %{service_name}-cs.socket
+systemctl start %{service_name}-wp.socket
+systemctl start %{service_name}-admin.socket
+systemctl start %{service_name}-popup.socket
+systemctl start %{service_name}.service
 
 %preun
-if [ $1 = 0 ]; then
-    systemctl stop %{service_name}.service
-    systemctl stop %{service_name}-cs.socket
-    systemctl stop %{service_name}-wp.socket
-    systemctl stop %{service_name}-admin.socket
-    systemctl stop %{service_name}-popup.socket
-fi
+systemctl stop %{service_name}-popup.service
+systemctl stop %{service_name}.service
+systemctl stop %{service_name}-cs.socket
+systemctl stop %{service_name}-wp.socket
+systemctl stop %{service_name}-admin.socket
+systemctl stop %{service_name}-popup.socket
 
 %postun
 if [ $1 = 0 ]; then
+    # uninstall
     systemctl daemon-reload
 fi