From 4421cb5389064fdefc6c3d8bfbcebebfc81e7b3c Mon Sep 17 00:00:00 2001 From: Utkarsh Srivastava Date: Tue, 30 Jan 2024 16:39:47 +0530 Subject: [PATCH] fix NooBaa NSFS RPM Upgrade Signed-off-by: Utkarsh Srivastava --- src/deploy/RPM_build/noobaa.spec | 35 -------------------------------- src/deploy/noobaa_nsfs.service | 1 + 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/deploy/RPM_build/noobaa.spec b/src/deploy/RPM_build/noobaa.spec index 4df43bdea6..9e44d4d58f 100644 --- a/src/deploy/RPM_build/noobaa.spec +++ b/src/deploy/RPM_build/noobaa.spec @@ -75,41 +75,6 @@ if [ "${state}" == "active" ]; then service rsyslog restart fi -if [ $1 -gt 1 ]; then - UPGRADE_SCRIPTS_DIR=/root/node_modules/noobaa-core/src/upgrade/upgrade_scripts - NSFS_UPGRADE_SCRIPTS_DIR=/root/node_modules/noobaa-core/src/upgrade/nsfs_upgrade_scripts - - NOOBAA_RPM_BASE_PATH="$RPM_BUILD_ROOT/usr/local/noobaa-core" - pushd $NOOBAA_RPM_BASE_PATH - - echo "Checking deployment type" - echo "Looking for NSFS deployment" - pgrep -f "cmd/nsfs" > /dev/null - rc=$? - if [ "${rc}" -eq 0 ]; then - echo "Found NSFS deployment" - /usr/local/noobaa-core/bin/node src/upgrade/upgrade_manager.js --nsfs true --upgrade_scripts_dir ${NSFS_UPGRADE_SCRIPTS_DIR} - rccmd=$? - else - echo "Looking for non-NSFS deployment" - pgrep -f "server/web_server" > /dev/null - rc=$? - if [ "${rc}" -eq 0 ]; then - echo "Found non-NSFS deployment" - /usr/local/noobaa-core/bin/node src/upgrade/upgrade_manager.js --upgrade_scripts_dir ${UPGRADE_SCRIPTS_DIR} - rccmd=$? - else - echo "No deployments found, skipping upgrade" - exit 0 - fi - fi - - if [ ${rccmd} -ne 0 ]; then - echo "upgrade_manager failed with exit code ${rccmd}" - exit ${rccmd} - fi -fi - %changelog * %{releasedate} NooBaa Team %{changelogdata} diff --git a/src/deploy/noobaa_nsfs.service b/src/deploy/noobaa_nsfs.service index af987a361c..3c01b8a78c 100644 --- a/src/deploy/noobaa_nsfs.service +++ b/src/deploy/noobaa_nsfs.service @@ -7,6 +7,7 @@ Restart=always RestartSec=2 User=root Group=root +ExecStartPre=/usr/local/noobaa-core/bin/node /usr/local/noobaa-core/src/upgrade/upgrade_manager.js --nsfs true --upgrade_scripts_dir /usr/local/noobaa-core/src/upgrade/nsfs_upgrade_scripts ExecStart=/usr/local/noobaa-core/bin/node /usr/local/noobaa-core/src/cmd/nsfs.js EnvironmentFile=-/etc/sysconfig/noobaa_nsfs ExecStop=/bin/kill $MAINPID