Tremulous Forum
Community => Servers => Topic started by: systemkiller on July 26, 2007, 11:01:40 am
-
Hi,
my problem is, i had only putty to connect to my server
i can start tremulous server with it but when i left putty the server goes offline,
does somebody had a server start script and can post here?
Thanks,
Systemkiller
-
use screen to run it.
CTRL + a + d
to detach a screen. You can then exit and screen will keep running.
screen -r pid
to reattach later when you reconnect.
edit: Of course, you could use this (http://tuplesplayhouse.blogspot.com/2006/08/tremulous-init-script.html)
It will need to be modified to work for you. This version worked for me once, though I'm sure my present version looks pre No console access here though, which frankly is something I've found to be almost entirely worthless. I use XQF for any kind of rcon stuff I need to do, which may be a lot when you put up a new server.
In case that old thing is FUBAR, here is the one I've been using:
#! /bin/sh
set -e
# If you look, you'll see how this is screwed up
BASEPATH="/usr/local/tremulous/.tremulous"
BINPATH="/usr/local/games/tremulous"
# This is the sum total of what I've done to run trem chrooted
# Impressive, isn't it :-P
CHROOTDIR="/usr/local/tremulous"
BINARY="tremded.x86"
DAEMON="$BINPATH/$BINARY"
OPTIONS="+set dedicated 2 +set fs_game base +exec server.cfg"
RUNAS="tremulous:tremulous"
PIDFILE="$BASEPATH/$BINARY.pid"
test -x $DAEMON || exit 0
#export HOME=$BASEPATH
export HOME=/usr/local/tremulous
case "$1" in
start)
echo -n "Starting Tremulous Server"
cd $BASEPATH
start-stop-daemon --start --quiet -c $RUNAS --pidfile $PIDFILE \
-N -2 -m -b -d $BASEPATH --exec $DAEMON -- $OPTIONS
echo "."
;;
stop)
echo -n "Stopping Tremulous Server"
start-stop-daemon --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
echo "."
;;
restart|force-reload)
echo -n "Cycling Tremulous Server - "
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
change BINPATH, BASEPATH, HOME to represent your directory setup. Change the RUNAS to reflect the user:group you want it to run as. change OPTIONS to your server options, though the OPTIONS will work just find for %90 to %95 of people I'd think.
Last but not least, thank Tuple like crazy so that he forgets how crappy this script looks and prevents him from descending into depression while realizing how easy this script would be to fix, and how interminably lazy he is to not bother. :P
let the criticism begin! :-D
This init script originally copied from here (http://wiki.splitbrain.org/q3aserver)
-
<noob_idea>
erm... wouldn't adding an & at the end just do it? (i dont rly use ssh that much)
</noob_idea>
-
Noobius"]<noob_idea>
erm... wouldn't adding an & at the end just do it? (i dont rly use ssh that much)
</noob_idea>
No. Running `program &` leaves the program attached to your bash session as a child and when you quit the session, all children will get SIGHUP and quit (unless they ignore SIGHUP which Tremulous alone does not).
-
doing (trem command&)& will fully dissociate the command so it still runs when you log off, however leaves you with no way to access the server via ssh.
What I do is 'screen -R trem' which opens/creates a screen called trem. just run it each time you want to start / edit the server.