PDA

View Full Version : Restart program after restart...



Jackster
31-12-10, 21:02
So i was given:


# Startup ventrilo servers.

VENPATH=/home/ventrilo
VENBIN=$VENPATH/ventrilo_srv

su ventrilo -c "$VENBIN -f$VENPATH/ventrilo_srv -d"

renice -5 `cat $VENPATH/ventrilo_srv.pid`

So if i had a program in "/home/gameserver/linux_svr"

And to start it you have to do "nohup ./server_svr &"


How would that fit in?

Thanks,

Lorem-Ipsum
31-12-10, 21:06
you put it in the .bashrc in your home folder. You then have to log out and log in again for it to take effect.

Jackster
31-12-10, 21:30
I know were to put it, It's configuring to put my file into that code.

Lorem-Ipsum
31-12-10, 21:40
Its different on different linux OS's mate.

I presume you're still using centOS so, as root add:


nohup /home/gameserver/linux_svr &to your /etc/rc.d/rc.local file.

You will need the full location from the root / directory.

linux_svr must be executable though.

Jackster
31-12-10, 21:42
So just the run command?? one per line?

Lorem-Ipsum
31-12-10, 21:43
So just the run command?? one per line?
I guess so.

If you want me to check post the contents of your /etc/rc.d/rc.local file and I'll have a look.

Jackster
31-12-10, 21:49
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
..........

Lorem-Ipsum
31-12-10, 21:57
..........

ooo, nice and simple then.


#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local ;
nohup /home/gameserver/linux_svr &

You will need to add the semi colon after a space to the end of the line above. (put in red)

Jackster
31-12-10, 22:00
ooo, nice and simple then.

I didn't have enough words in my post. Sorry if you took it bad in some way?


You will need to add the semi colon after a space to the end of the line above. (put in red)

Ah thanks i will give it a go.

Lorem-Ipsum
31-12-10, 22:03
I didn't have enough words in my post. Sorry if you took it bad in some way?


LOL. I didn't notice the .'s until you apologised for it XD

I was more interested in the code XD.

Jackster
31-12-10, 22:22
:P.................. < I put them in as i only used 2 letters for the ":p"








Just pointing out :)


Sadly some people are using the TeamSpeak server so i can't test it out.

Thanks dude, Ill +1 if i can.