Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: Denbert on July 25, 2008, 02:07:53 PM

Title: I need a startup script for my Quake 3 server
Post by: Denbert on July 25, 2008, 02:07:53 PM
Hi there,

I've been running a quake 3 server on Debian "ETCH" for the last year without any problems.

I've now installed the SME 7.3 server and added a user called quake.

The quake server is installed in /home/e-smith/files/users/quake/home/quake

I've tried to modify my Debian startup script seen below:


#! /bin/sh
set -e

BASEPATH="/home/e-smith/files/users/quake/home/quake"
BINARY="ioq3ded.i386"
DAEMON="$BASEPATH/$BINARY"
OPTIONS="+set dedicated 1 +set com_hunkmegs 32 +set fs_game osp +exec clanarena.cfg"
RUNAS="quake:users"
PIDFILE="$BASEPATH/$BINARY.pid"

test -x $DAEMON || exit 0

export HOME=$BASEPATH

case "$1" in
  start)
        echo -n "Starting Quake III OSP Server"
        cd $BASEPATH
        start-stop-daemon --start --quiet -c $RUNAS --pidfile $PIDFILE \
                -N -10 -m -b -d $BASEPATH --exec $DAEMON -- $OPTIONS
        echo "."
        ;;
  stop)
        echo -n "Stopping Quake III OSP Server"
        start-stop-daemon --stop --quiet --pidfile $PIDFILE \
                --exec $DAEMON
        echo "."
        ;;
  restart|force-reload)
        $0 stop
        sleep 3
        $0 start
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0


and added it in /etc/rc.d/init.d/ directory

When i try to run the /etc/rc.d/init.d/quakeserver start command I'm getting this error:

Starting Quake III OSP Server/etc/rc.d/init.d/quakeserver: line 19: start-stop-daemon: command not found

I've looked in the development documentation on how to startup programs on system boot http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Starting_up_programs_automatically_upon_system_boot (http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Starting_up_programs_automatically_upon_system_boot), but i don't get it  :-(

I'm surely missing some details in how to set up this startup script - could anyone please point me in the right direction?

/ Denbert

Title: Re: I need a startup script for my Quake 3 server
Post by: william_syd on July 25, 2008, 04:16:25 PM
Maybe you should consider using runit.

Have a look at the Ventrilo how to in the wiki.

A possible run script could be

Code: [Select]
#!/bin/sh
exec 2>&1
exec sudo -u quake                                                         \
/home/e-smith/files/users/quake/home/quake/ioq3ded.i386                    \
+set dedicated 1 +set com_hunkmegs 32 +set fs_game osp +exec clanarena.cfg \

How did you install Q3 ?


Title: Re: I need a startup script for my Quake 3 server
Post by: Denbert on July 25, 2008, 06:19:59 PM

How did you install Q3 ?


Thanks for your suggestion for a startup script - where do I put it?

About Q3 install I did the following:

Made a user called "quake"

Transferred the http://ioquake3.org/files/ioquake3-1.34-rc3.run (http://ioquake3.org/files/ioquake3-1.34-rc3.run) file (licensed under GPL see http://ioquake3.org/ (http://ioquake3.org/) for more information) to the Home directory of user "quake" by FTP - Remember to enable the FTP server :-)

in oder to have shell access for the "quake" user I installed Remote User contrib by Dungog - http://www.dungog.net/wiki/Smeserver-remoteuseraccess (http://www.dungog.net/wiki/Smeserver-remoteuseraccess)

After enabling shell access I changed the file to be run by owner and installed the ioquake file by logging in as "quake" and typing ./ioquake3-1.34-rc3.run - enter, then follow the install shell on the screen :-)

You will still need a original Quake3 CD to have the data from the /baseq3 dir, where all the .pak files are stored.

If you have Quake 3 you can try connecting to hegnstoften.net on default port 27960

I'll try to make a more detailed howto setup Quake and Unreal Tournament servers on SME as soon as I have the startup script running.

/ Denbert
Title: Re: I need a startup script for my Quake 3 server
Post by: william_syd on July 26, 2008, 03:35:05 AM
Do you have libSDL-1.2.so installed?

updatedb
locate libSDL-1.2.so


Just had a test run (on a SME8 beta test VM) and it complained about missing that shared library.

I think I saw a yum repo that may have all the files already...  I will search.



Edit:
I might be digging a hole for myself so I will retry this with a SME7.3 VM in a day or so. Follow the Ventrilo how-to in the wiki and just change the file names/locations as required.

or

Pull one of the other startup scripts apart and find a replacement for start-stop-daemon which is a Debian thing (according to Google)


Title: Re: I need a startup script for my Quake 3 server
Post by: Denbert on July 26, 2008, 09:08:20 AM
Do you have libSDL-1.2.so installed?

updatedb
locate libSDL-1.2.so



No, the Quake installation was made on a fresh installed SME 7.3 with the mentioned Remote User Access contrib from dungog.

I have opened port 27960 via port forward to local host from the Server-Manager. This might not be the right way to do it, but it works fine - In the old 6.X days, there was a port opening contrib, I've searched for "port opening" but i can't find a contrib.

Can the /gamedir/gameexec start - stop - restart command be done with your suggested script as on Debian?

I think this is a very useful feature.

/ Denbert
Title: Re: I need a startup script for my Quake 3 server
Post by: FraunhoferIFF on July 27, 2008, 10:08:58 PM
rpm -Uvh http://sme.swerts-knudsen.dk/downloads/dmc-mitel-portopening-0.0.1-4.noarch.rpm

Marcel
Title: Re: I need a startup script for my Quake 3 server
Post by: janet on July 28, 2008, 03:44:47 AM
Denbert

Quote
I have opened port 27960 via port forward to local host from the Server-Manager.

That is the correct way to do it.
The port forwarding panel in sme7.x is actually a port opening and port forwarding panel, if you read the descriptive text carefully.
Do not install any old port opening contrib.
Title: Re: I need a startup script for my Quake 3 server
Post by: Lum-chan on August 12, 2008, 11:37:06 PM
I have added some info for you on your other thread: http://forums.contribs.org/index.php?topic=41696.msg195731#msg195731
Hope that helps a bit