The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Quake3 dedicated server as a daemon on start-up?
Author: bryan 
Date:   05-03-02 08:54

How can I set up my box to boot up and start q3ded as a daemon? I have the server setup, and it runs when I run it as a user, but I would like to run it as a daemon and not have it occupy a virtual terminal. I think I may have it running a quick and dirty way, but I would like to know the best way possible of doing this. Thanks.

-Bryan

Reply To This Message
 
 Re: Quake3 dedicated server as a daemon on start-up?
Author: .daniel.schrock 
Date:   05-03-02 19:23

here is my start script:

#!/bin/sh

case $1 in
start)
if [ -x /usr/local/bin/q3server ]; then
/usr/local/bin/q3server && echo "Starting Quake3 server..."
fi
if [ -x /usr/local/bin/ra3server ]; then
/usr/local/bin/ra3server && echo "Starting Rocket Arena server..."
fi
;;
stop)
ps aux | grep q3ded | grep -v grep | awk '{print $2}' | xargs -t kill $2;
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
q3start)
ps aux | grep q3ded | grep -v grep | awk '{print $2}';
# if [ $2 != ""]; then
# echo "Quake 3 Server is already running"
# exit 0;
#else
/usr/local/bin/q3server && echo "Starting Quake3 server..."
ps aux | grep q3ded | grep -v grep
#fi
;;
ra3start)
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}';
if [ $2 -eq ""]; then
echo "Rocket Arena 3 Server is already running"
exit 0;
else
/usr/local/bin/ra3server && echo "Starting Rocket Arena 3 server..."
ps aux | grep quake3.x86 | grep -v grep
fi
;;
q3stop)
ps aux | grep q3ded | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
ra3stop)
ps aux | grep quake3.x86 | grep -v grep | awk '{print $2}' | xargs -t kill $2;
;;
status)
echo 'Checking for q3 process...'
ps auxwww | grep q3ded | grep -v grep
echo ''
echo 'Checking q3 info...'
/usr/local/bin/q3ctrl --info
echo ''
echo 'Checking q3 status...'
/usr/local/bin/q3ctrl --status
echo ''
echo ''
echo 'Checking for ra3 process...'
ps auxwww | grep quake3.x86 | grep -v grep
echo ''
echo 'Checking ra3 info...'
/usr/local/bin/ra3ctrl --info
echo ''
echo 'Checking ra3 status...'
/usr/local/bin/ra3ctrl --status
;;
*)
echo "Usage: `basename $0` { start | stop | q3start | q3stop | ra3start | ra3stop | status }"
exit 64
;;

esac

exit 0

here are the scripts that are run by the above:
q3server:
#!/bin/sh
cd /usr/local/quake3
./q3ded +set com_hunkmegs 64 +set dedicated 2 +set net_ip xxx.xxx.xxx.xxx +set net_port 27960 +set sv_pure
1 +set sv_allowdownload 1 +set fs_base "/usr/local/quake3" +exec q3server.cfg &

ra3server:
#!/bin/sh
cd /usr/local/quake3
./quake3.x86 +set com_hunkmegs 64 +set fs_game arena +set sv_pure 1 +bot_enable 0 +set dedicated 2 +set net
_ip xxx.xxx.xxx.xxx +set net_port 27970 +set sv_allowdownload 1 +set fs_base "/usr/local/quake3" +exec ra3s
erver.cfg &



be sure to edit these to follow your paths and IPs.
keep in mind that once gamespy knows of your servers, your bandwidth will get sucked up fast, if you have a decent connection. This is why i stopped running my q3 and ra3 servers, but I still get people trying to connect on occasion.

Reply To This Message
 
 Re: Quake3 dedicated server as a daemon on start-up?
Author: bryan 
Date:   06-03-02 01:01

so when you ran your server this way, which user is running the server, root? If so, is this bad, because as of now I have my q3ded running without occupying my virtual terminal, but it is run by root. Thanks in advance.

-bryan

Reply To This Message
 
 Re: Quake3 dedicated server as a daemon on start-up?
Author: .daniel.schrock 
Date:   06-03-02 01:55

Mine was run as root. I was not overly concerned, since there is absolutely nothing that can be done either in the game console or in the game itself that can have an effect on the rest of the server.

But if you are really that concerned, you can use su to launch the game as another user. I can't remember the exact flags for it, but it can be done.

Reply To This Message
 
 Re: Quake3 dedicated server as a daemon on start-up?
Author: F l y 
Date:   03-11-06 12:06

good

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org