1

Topic: config not existing

I am using an init script with Ubuntu 8.10. Everytime I try to run it I get an error saying that the config file does not exist. I have tried just putting it in the TWSERVER_DIR folder and also tried putting it into a config folder inside of the folder. Any ideas?

Here is my init script:

#! /bin/sh -e
# Copyright (c) 2008 Stas Sushkov (stas@nerd.ro)
# Released under GPL 2.0 (http://creativecommons.org/licenses/GPL/2.0/)
# Author: Stas Sushkov, Sept. 2008
### BEGIN INIT INFO
# Provides:          teeworlds-server
# Required-Start:    $network
# Required-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: teeworlds-server daemon, providing teeworlds server administration
# Description:       Teeworlds is an online multi-player plat?form 2D shooter.
#    teeworlds-server is a server for Teeworlds game.
### END INIT INFO

# Used variables
TWSERVER_BIN_DIR=/opt/games/teewars
TWSERVER_DIR=/var/run/teewars
TWSERVER_CONFIG=teeworlds_srv.cfg
TWSERVER_NAME=teeworlds_srv
TWSERVER_OPTS="-q -f $TWSERVER_DIR/$TWSERVER_CONFIG"
TWSERVER_PIDFILE=$TWSERVER_DIR/$TWSERVER_NAME.pid

# Loading init-functions
. /lib/lsb/init-functions

# Check for missing binaries
test -x $TWSERVER_BIN_DIR/$TWSERVER_NAME || { echo "$TWSERVER_BIN_DIR/$TWSERVER_NAME not installed";
        if [ "$1" = "stop" ]; then exit 0;
    else exit 5; fi; }

# Check for existence of needed config file and read it
test -r $TWSERVER_DIR/$TWSERVER_CONFIG || { echo "$TWSERVER_DIR/$TWSERVER_CONFIG not existing";
    if [ "$1" = "stop" ]; then exit 0;
    else exit 6; fi; }

case "$1" in
    start)
        log_begin_msg "Starting Teeworlds Server..."
        umask 002
        if start-stop-daemon -v --start --background \
            --pidfile $TWSERVER_PIDFILE --make-pidfile \
            -d $TWSERVER_DIR \
            --chuid games:games \
            --exec $TWSERVER_BIN_DIR/$TWSERVER_NAME -- $TWSERVER_OPTS; then
            log_end_msg 0
        else
            log_end_msg $?
        fi
    ;;

    stop)
        log_begin_msg "Stopping Teeworlds Server..."
        if start-stop-daemon --stop \
            --pidfile $TWSERVER_PIDFILE; then
            log_end_msg 0
        else
            log_end_msg $?
        fi
    ;;

    restart|force-reload)
        "$0" stop && "$0" start
    ;;

    *)
    echo "Usage: /etc/init.d/teeworlds-server {start|stop|restart}"
        exit 1
    ;;
esac

exit 0

2

Re: config not existing

Do you really keep your config in /var/run/teewars/teeworlds_srv.cfg and not in /opt/games/teewars/teeworlds_srv.cfg ?

Used to be very active waay back

3 (edited by FireArrow 2009-04-12 23:27:39)

Re: config not existing

Did'nt know it made a difference. I was just following a setup tutorial. Will move it and see what happens.

EDIT: Still says the same thing, even with it in /opt/games/teewars/teeworlds_srv.cfg.

4 (edited by FireArrow 2009-04-12 23:27:05)

Re: config not existing

It doesn't make a difference. I'm just making sure your not mixing up your variables/paths wink

EDIT: Try to name the file something else, like "myserver.cfg"

Used to be very active waay back

5

Re: config not existing

Ok, I renamed it to settings.cfg and it is still not working. Even tried going to the folder where teeworlds_srv is and running ./teeworlds_srv -f settings.cfg.

This is what I get.
http://img6.imageshack.us/img6/6494/serverl.th.png

6

Re: config not existing

I have same problem and same output screen as user desrik :-/.