From f875a109b45d43987f2bda2a3588f804d067e3ec Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Wed, 8 May 2024 12:33:05 +0200 Subject: [PATCH 1/4] Added init.d link on destdir install --- pandora_server/pandora_server_installer | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 092681a8b4..0c3151c44a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -146,12 +146,12 @@ install_startup_script () { [ -d $DESTDIR$INITDIR ] || mkdir -p $DESTDIR$INITDIR cp $SRC $DESTDIR$INITDIR - [ "$DESTDIR" ] && return - case $DISTRO in UBUNTU|DEBIAN) echo "Linking startup script to /etc/rc2.d" update-rc.d $SCRIPT_NAME defaults + ln -s $DESTDIR$INITDIR/$SCRIPT_NAME /etc/init.d/$SCRIPT_NAME + systemctl daemon-reload 2> /dev/null ;; SUSE) echo "Creating startup daemons" @@ -167,7 +167,9 @@ install_startup_script () { INITLV=`grep '[0-9]:initdefault' /etc/inittab | cut -f 2 -d ':'` : ${INITLV:=2} echo "Linking startup script to /etc/rc.d/rc$INITLV.d/S$SPRIO$SCRIPT_NAME" - ln -s $INITDIR/$SCRIPT_NAME /etc/rc.d/rc$INITLV.d/S$SPRIO$SCRIPT_NAME + ln -s $DESTDIR$INITDIR/$SCRIPT_NAME /etc/rc.d/rc$INITLV.d/S$SPRIO$SCRIPT_NAME + ln -s $DESTDIR$INITDIR/$SCRIPT_NAME /etc/init.d/$SCRIPT_NAME + systemctl daemon-reload 2> /dev/null fi ;; esac @@ -300,13 +302,15 @@ install () { if [ $? -eq 0 ]; then echo " " echo "User pandora does exist, make sure the SSH directories are correct" - elif [ "$DESTDIR" ] - then - # chown can fail with fakeroot installation - echo "User 'pandora' does not exist. All chown operations may fail." - echo "You should manualy set proper ownership to $DESTDIR$PANDORA_SPOOL if needed." - echo else + if [ "$DESTDIR" ] + then + # chown can fail with fakeroot installation + echo "User 'pandora' does not exist. All chown operations may fail." + echo "You should manualy set proper ownership to $DESTDIR$PANDORA_SPOOL if needed." + echo + fi + echo "Are you sure we can create a standard 'pandora' user locally? [y/N]" read AREYOUSURE if [ "$AREYOUSURE" = "y" ]; then @@ -562,6 +566,8 @@ EOF [ "$WITHOUT_TENTACLE" = 0 ] && \ echo "Define '$TENTACLE_RC_VAR=\"YES\"' in /etc/rc.conf to enable tentacle server daemon." fi + + systemctl daemon-reload 2> /dev/null } uninstall () { From 5169fec3a0534874933924ec6b24d82d2df90a66 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Fri, 17 May 2024 11:38:36 +0200 Subject: [PATCH 2/4] Removed destdir from systemdir --- pandora_server/pandora_server_installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 0c3151c44a..da738086d7 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -499,7 +499,7 @@ install () { chmod +x "$INSTALL_DIR/pandora_ha" ;; *) - SYSTEMD_DIR=$DESTDIR/etc/systemd/system + SYSTEMD_DIR=/etc/systemd/system PID_DIR=$DESTDIR/var/run INSTALL_DIR="$DESTDIR$PREFIX/bin/" From ee9af06e1690dabb2cbb3b20338375b8cd590f2d Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Fri, 17 May 2024 13:09:32 +0200 Subject: [PATCH 3/4] Fixed pandora_server.conf variable --- pandora_server/pandora_server_installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index da738086d7..f5f1c8285d 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -520,7 +520,7 @@ Type=forking User=$USER PIDFile=$PID_DIR/pandora_ha.pid Restart=always -ExecStart=${INSTALL_DIR}pandora_ha -d -p $PID_DIR/pandora_ha.pid $PANDORA_CONF +ExecStart=${INSTALL_DIR}pandora_ha -d -p $PID_DIR/pandora_ha.pid $DESTDIR$PANDORA_CFG_FILE [Install] WantedBy=multi-user.target From b21b3ab20b8863bb8c5fea6d47201c634cf8e7a7 Mon Sep 17 00:00:00 2001 From: Enrique Martin Date: Fri, 17 May 2024 13:11:22 +0200 Subject: [PATCH 4/4] Fixed destdir for pandora_db.pl cron execution --- pandora_server/pandora_server_installer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index f5f1c8285d..20c8b3dd80 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -534,7 +534,7 @@ EOF [ ! -d $DESTDIR/etc/cron.hourly ] && mkdir -p $DESTDIR/etc/cron.hourly echo "Creating the Cron script to run Pandora DB tool each hour" echo "#!/bin/bash" > $DESTDIR/etc/cron.hourly/pandora_db - echo "perl $PANDORA_HOME/util/pandora_db.pl /etc/pandora/pandora_server.conf" >> $DESTDIR/etc/cron.hourly/pandora_db + echo "perl $DESTDIR$PANDORA_HOME/util/pandora_db.pl $DESTDIR$PANDORA_CFG_FILE" >> $DESTDIR/etc/cron.hourly/pandora_db chmod +x $DESTDIR/etc/cron.hourly/pandora_db elif [ "$DISTRO" = "FreeBSD" ] || [ "$DISTRO" = "NetBSD" ] then