on 05-29-2009 10:39 AM
Hi all,
I installed the latest Testdrive on my Debian - Server.
Now I want the Testdrive to start each time the Server is rebooted (hopefully not too often ).
How is the best way to automatically log in as n4sadm and startsap n4shost in the environment of this user...?
Thx
Greets
Markus Völker
Hi Markus,
I'd create an init script called
/etc/init.d/saptestdrive
which contains
#!/bin/bash
case "$1" in
start)
su - n4sadm -c "startsap n4shost"
sleep 30
;;
stop)
su - n4sadm -c "stopsap"
sleep 30
;;
restart)
$0 stop
$0 start
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
You then need two links to your preferred runlevel (either 3 or 5):
ln -s /etc/init.d/saptestdrive /etc/rc3.d/S99saptestdrive
ln -s /etc/init.d/saptestdrive /etc/rc3.d/K01saptestdrive
Alternatively, you could edit /etc/rc.local (adding su - n4sadm -c "...") and it should work,
Thanks,
Hannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.