Re: segfaults when not supplying -r option

Shane Allen <[email protected]>
Newsgroups gmane.network.tux
Message-ID <[email protected]>
On Wed, Jul 10, 2002 at 07:38:43PM +0200, Jon Åslund wrote:
> Linux version 2.4.18tux (root@jonsdebianburk) (gcc version 2.95.4
>  20011002 (Debian prerelease)) #1 Tue Jul 9 21:02:19 CEST 2002
> 
> Because the tux.init script didn't work (I guess, very redhat

It's been a while since we set these boxen up, so I'm not sure if we're actually using the stock init script or one that we hacked, but below is my system info and a copy of our working init script (we've never had any problem with tux installations on Debian):

Linux version 2.4.17 (root@i-1) (gcc version 2.95.4 20011006 (Debian prerelease)) #1 SMP Tue Mar 26 13:55:34 CST 2002

(note that while we're using 2.4.17, we patched it with the latest tux)

--Start script--
#! /bin/sh
#
# tux        This starts and stops the TUX kernel-based http server.
#
# chkconfig: - 50 50
# description: The TUX threaded kernel-based http server
#
# processname: /usr/sbin/tux
# config: /etc/sysconfig/tux
# config: /etc/sysctl.conf

# Set defaults
NRCPUS=$(cat /proc/cpuinfo | grep '^processor[   ]*:' | wc -l)
TUXTHREADS=$NRCPUS
EXTRAOPTS=

. /etc/sysconfig/tux

[ -z "$DOCROOT" ] && {
        echo "Must specify a docroot in /etc/sysconfig/tux" 1>&2
        exit 1
}
DOCROOT=$(echo $DOCROOT | sed 's:/*$:/:g')

[ -n "$MODULEPATH" ] && {
        EXTRAOPTS="$EXTRAOPTS -m $MODULEPATH"
}

[ -n "$DAEMON_UID" ] && EXTRAOPTS="$EXTRAOPTS -u $DAEMON_UID"
[ -n "$DAEMON_GID" ] && EXTRAOPTS="$EXTRAOPTS -g $DAEMON_GID"

isname(){
        [ -n "$(echo $1 | tr -d '0-9')" ]
        return $?
}

[ -z "$CGI_UID" ] && CGI_UID=nobody
isname $CGI_UID && CGI_UID=$(id -u $CGI_UID)
[ -z "$CGI_GID" ] && CGI_GID=nobody
isname $CGI_GID && CGI_GID=$(awk -F: "\$1 == \"$CGI_GID\" { print \$3 }" /etc/group)

[ -z "$CGIROOT" ] && CGIROOT=$DOCROOT
[ -z "$MAX_KEEPALIVE_TIMEOUT" ] && MAX_KEEPALIVE_TIMEOUT=30

[ -f /usr/sbin/tux ] || exit 1
RETVAL=0

start(){
    echo -n "Starting tux: "
    # TUX ships as a module but many installations will build
    # it into the kernel for maximum performance.  Try to modprobe
    # but failures are fine.
    modprobe tux >/dev/null 2>&1
    echo $TUXTHREADS > /proc/sys/net/tux/threads
    echo $DOCROOT > /proc/sys/net/tux/documentroot
    echo $CGI_UID > /proc/sys/net/tux/cgi_uid
    echo $CGI_GID > /proc/sys/net/tux/cgi_gid
    echo $CGIROOT > /proc/sys/net/tux/cgiroot
    echo 1 > /proc/sys/net/tux/generate_etags
    echo 1 > /proc/sys/net/tux/generate_last_mod
    echo 6000 > /proc/sys/net/tux/max_header_len
#    echo 100000 > /proc/sys/net/tux/max_object_size
    echo $MAX_KEEPALIVE_TIMEOUT > /proc/sys/net/tux/keepalive_timeout
    start-stop-daemon --start --exec /usr/sbin/tux -- -d -t $TUXTHREADS -r $DOCROOT $EXTRAOPTS $TUXMODULES
    RETVAL=$?
    echo
    touch /var/lock/subsys/tux
}

stop(){
    echo -n "Stopping tux: "
    /usr/sbin/tux --stop
    RETVAL=$?
    echo
    rm -f /var/lock/subsys/tux
}

restart(){
    stop
    start
}

condrestart(){
    [ -e /var/lock/subsys/tux ] && restart
}


# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    status)
        status /usr/sbin/tux
        ;;
    restart|reload)
        restart
        ;;
    condrestart)
        condrestart
        ;;
    *)
        echo "Usage: tux {start|stop|status|restart|condrestart|reload}"
        RETVAL=1
esac

exit $RETVAL

--End script--

-- 
Shane Allen <[email protected]>

sell.com : Buy & Sell Anything
http://www.sell.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.