Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings NUTSS
 
 
Summary Tracker Lists CVS Files
 

CVS | Administration


File:  [GForge:cvsroot/nutss] / libnutss / examples / nutssd.init
Revision 1.2: download - view: text, annotated - select for diffs
Fri May 4 09:08:18 2007 UTC (9 years, 10 months ago) by saikat
Branches: MAIN
CVS tags: HEAD
javasock now builds under linux

configure.ac, include/transport.h, src/Makefile.am, src/javasock.c,
src/transport.c, src/java/net/nutss/Makefile.am:
- Hook java support into linux build

examples/nutssd.c, doc/nutssd.1, examples/nutssd.init:
- Redirect stdout and srderr to a logfile

#!/bin/sh
#
# nutssd NUTSS services daemon
#
# chkconfig:   - 80 20
# description: Runs NUTSS services such as STUNT server, \
#              TURN server, Swaplinks registrar etc.
# processname: nutssd

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

exec="/usr/sbin/nutssd"
prog=nutssd

[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog

[ -z "$NUTSSD_URI" ] && exit 0
[ -z "$NUTSSD_REGISTRAR" ] && exit 0

NUTSSD_OPTS=${NUTSSD_OPTS:-"-st"}

lockfile=/var/lock/subsys/nutssd
logfile=/var/log/nutssd

start() {
    echo -n $"Starting $prog: "
    daemon $exec $NUTSSD_OPTS --registrar $NUTSSD_REGISTRAR --password "$NUTSSD_PASSWORD" --logfile $logfile $NUTSSD_URI
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    stop
    start
}

reload() {
    restart
}

force_reload() {
    restart
}

fdr_status() {
    status $prog
}

case "$1" in
    start|stop|restart|reload)
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        fdr_status
        ;;
    condrestart|try-restart)
  	[ ! -f $lockfile ] || restart
	;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        exit 2
esac

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
 

GForge.cis.cornell.edu is brought to you by

Cornell Computing and Information Science


Powered By GForge Collaborative Development Environment