From b50626d7534640049818457735c0c05835959323 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 24 Feb 2024 22:28:31 +1100 Subject: [PATCH] Updated init --- init | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/init b/init index 7d9ff3f..d10d978 100755 --- a/init +++ b/init @@ -5,7 +5,8 @@ NAME="SP" function stop { echo "Stopping ${NAME}" - echo "PLEASE connect with a client and issue HALT" && sleep 60 + kill $(pgrep dsmserv) + echo "You should really connect with a client and issue HALT" && sleep 60 } trap 'stop' SIGTERM @@ -18,6 +19,8 @@ if [ "$1" == "start" ]; then [ -x /opt/tivoli/tsm/server/bin/dsmserv ] && su ${USER} -lc /opt/tivoli/tsm/server/bin/dsmserv & + # **NOTE**: ln /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys to /tsm/dbbkapi/dsm.sys, otherwise backups will fail + ln -sf /tsm/dbbkapi/dsm.sys /opt/tivoli/tsm/server/bin/dbbkapi/dsm.sys wait # Init one needs to copy some data from the install /tsm directory to our persistent storage volume - so that volume should be mounted under /tsm.init @@ -41,9 +44,13 @@ elif [ "$1" == "upgrade" ]; then [ ! -f /tsm/.INIT -o ! -f /database/.INIT ] && echo "Please use -v :/tsm.init and :/database.init and re-run upgrade" && exit 1 /opt/tivoli/tsm/db2/instance/db2iupdt -d ${USER} -elif [ "$1" == "restore" ]; then +elif [ "$1" == "restoredb" ]; then su ${USER} -lc "dsmserv restore db ${2:+password=$2} restorekeys=yes on=DBDIRS.TXT" +elif [ "$1" == "restore" ]; then + echo "! Running [dsmserv $@]" + su ${USER} -lc "dsmserv $@" + else exec $@ fi