From 34a07158a3ab6c143e9436ef792db14e6b201b25 Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Tue, 21 Jun 2016 14:45:54 +0900 Subject: [PATCH] Separate install/upgarde case on %post Change-Id: If31d22c00cf26f1ad5e6e98142c370d1312f3030 Signed-off-by: Kyungwook Tak --- packaging/csr-framework.spec | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/packaging/csr-framework.spec b/packaging/csr-framework.spec index 1ba85e2..a12f08a 100644 --- a/packaging/csr-framework.spec +++ b/packaging/csr-framework.spec @@ -219,24 +219,41 @@ mkdir -p %{buildroot}%{engine_rw_working_dir} 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 + systemctl start %{service_name}-popup.service +fi + +if [ $1 = 2 ]; then + systemctl stop %{service_name}-cs.socket + systemctl stop %{service_name}-wp.socket + systemctl stop %{service_name}-admin.socket + systemctl stop %{service_name}-popup.socket + + systemctl stop %{service_name}-popup.service + systemctl stop %{service_name}.service -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 + systemctl restart %{service_name}.service + systemctl restart %{service_name}-popup.service +fi %preun -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 +if [ $1 = 0 ]; then + 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 +fi %postun if [ $1 = 0 ]; then - # uninstall systemctl daemon-reload fi -- 2.7.4