Added init.d link on destdir install

This commit is contained in:
Enrique Martin 2024-05-08 12:33:05 +02:00
parent 0c123c7fc2
commit f875a109b4
1 changed files with 15 additions and 9 deletions

View File

@ -146,12 +146,12 @@ install_startup_script () {
[ -d $DESTDIR$INITDIR ] || mkdir -p $DESTDIR$INITDIR [ -d $DESTDIR$INITDIR ] || mkdir -p $DESTDIR$INITDIR
cp $SRC $DESTDIR$INITDIR cp $SRC $DESTDIR$INITDIR
[ "$DESTDIR" ] && return
case $DISTRO in case $DISTRO in
UBUNTU|DEBIAN) UBUNTU|DEBIAN)
echo "Linking startup script to /etc/rc2.d" echo "Linking startup script to /etc/rc2.d"
update-rc.d $SCRIPT_NAME defaults update-rc.d $SCRIPT_NAME defaults
ln -s $DESTDIR$INITDIR/$SCRIPT_NAME /etc/init.d/$SCRIPT_NAME
systemctl daemon-reload 2> /dev/null
;; ;;
SUSE) SUSE)
echo "Creating startup daemons" echo "Creating startup daemons"
@ -167,7 +167,9 @@ install_startup_script () {
INITLV=`grep '[0-9]:initdefault' /etc/inittab | cut -f 2 -d ':'` INITLV=`grep '[0-9]:initdefault' /etc/inittab | cut -f 2 -d ':'`
: ${INITLV:=2} : ${INITLV:=2}
echo "Linking startup script to /etc/rc.d/rc$INITLV.d/S$SPRIO$SCRIPT_NAME" 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 fi
;; ;;
esac esac
@ -300,13 +302,15 @@ install () {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo " " echo " "
echo "User pandora does exist, make sure the SSH directories are correct" echo "User pandora does exist, make sure the SSH directories are correct"
elif [ "$DESTDIR" ] else
if [ "$DESTDIR" ]
then then
# chown can fail with fakeroot installation # chown can fail with fakeroot installation
echo "User 'pandora' does not exist. All chown operations may fail." 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 "You should manualy set proper ownership to $DESTDIR$PANDORA_SPOOL if needed."
echo echo
else fi
echo "Are you sure we can create a standard 'pandora' user locally? [y/N]" echo "Are you sure we can create a standard 'pandora' user locally? [y/N]"
read AREYOUSURE read AREYOUSURE
if [ "$AREYOUSURE" = "y" ]; then if [ "$AREYOUSURE" = "y" ]; then
@ -562,6 +566,8 @@ EOF
[ "$WITHOUT_TENTACLE" = 0 ] && \ [ "$WITHOUT_TENTACLE" = 0 ] && \
echo "Define '$TENTACLE_RC_VAR=\"YES\"' in /etc/rc.conf to enable tentacle server daemon." echo "Define '$TENTACLE_RC_VAR=\"YES\"' in /etc/rc.conf to enable tentacle server daemon."
fi fi
systemctl daemon-reload 2> /dev/null
} }
uninstall () { uninstall () {