cancel
Showing results for 
Search instead for 
Did you mean: 

How to start Testdrive automatically on Debian?

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

hannes_kuehnemund
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thx,

10p for you, but I have another question:

can I "log in" as n4sadm at boot without password?

My questions comes up, because I always have to give the password for n4sadm (even if I su to n4sadm as root)

hannes_kuehnemund
Active Contributor
0 Kudos

Uh,

this seems to be a Debian thing, because I can log on as n4sadm being root w/o password.

Is there any one in the forum, who knows Debian in more detail who could answer the question?

Thanks,

Hannes

Former Member
0 Kudos

It shouldn't require password if you su form root to other users. Are you sure? Can you try to su to other users then n4sadm from root?

Former Member
0 Kudos

Yes I am sure...

I stole root some rights to do this and that .. (just in case...)

Answers (0)