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

CVS | Administration

Annotation of libnutss/examples/nutssd.init, revision 1.2

1.1       saikat      1: #!/bin/sh
                      2: #
                      3: # nutssd NUTSS services daemon
                      4: #
                      5: # chkconfig:   - 80 20
                      6: # description: Runs NUTSS services such as STUNT server, \
                      7: #              TURN server, Swaplinks registrar etc.
                      8: # processname: nutssd
                      9:
                     10: # Source function library.
                     11: . /etc/rc.d/init.d/functions
                     12:
                     13: # Source networking configuration.
                     14: . /etc/sysconfig/network
                     15:
                     16: # Check that networking is up.
                     17: [ "$NETWORKING" = "no" ] && exit 0
                     18:
                     19: exec="/usr/sbin/nutssd"
                     20: prog=nutssd
                     21:
                     22: [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
                     23:
                     24: [ -z "$NUTSSD_URI" ] && exit 0
                     25: [ -z "$NUTSSD_REGISTRAR" ] && exit 0
                     26:
                     27: NUTSSD_OPTS=${NUTSSD_OPTS:-"-st"}
                     28:
                     29: lockfile=/var/lock/subsys/nutssd
1.2     ! saikat     30: logfile=/var/log/nutssd
1.1       saikat     31:
                     32: start() {
                     33:     echo -n $"Starting $prog: "
1.2     ! saikat     34:     daemon $exec $NUTSSD_OPTS --registrar $NUTSSD_REGISTRAR --password "$NUTSSD_PASSWORD" --logfile $logfile $NUTSSD_URI
1.1       saikat     35:     retval=$?
                     36:     echo
                     37:     [ $retval -eq 0 ] && touch $lockfile
                     38:     return $retval
                     39: }
                     40:
                     41: stop() {
                     42:     echo -n $"Stopping $prog: "
                     43:     killproc $prog
                     44:     retval=$?
                     45:     echo
                     46:     [ $retval -eq 0 ] && rm -f $lockfile
                     47:     return $retval
                     48: }
                     49:
                     50: restart() {
                     51:     stop
                     52:     start
                     53: }
                     54:
                     55: reload() {
                     56:     restart
                     57: }
                     58:
                     59: force_reload() {
                     60:     restart
                     61: }
                     62:
                     63: fdr_status() {
                     64:     status $prog
                     65: }
                     66:
                     67: case "$1" in
                     68:     start|stop|restart|reload)
                     69:         $1
                     70:         ;;
                     71:     force-reload)
                     72:         force_reload
                     73:         ;;
                     74:     status)
                     75:         fdr_status
                     76:         ;;
                     77:     condrestart|try-restart)
                     78:     [ ! -f $lockfile ] || restart
                     79:       ;;
                     80:     *)
                     81:         echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
                     82:         exit 2
                     83: 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