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.1

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
        !            30:
        !            31: start() {
        !            32:     echo -n $"Starting $prog: "
        !            33:     daemon $exec $NUTSSD_OPTS --registrar $NUTSSD_REGISTRAR --password "$NUTSSD_PASSWORD" $NUTSSD_URI
        !            34:     retval=$?
        !            35:     echo
        !            36:     [ $retval -eq 0 ] && touch $lockfile
        !            37:     return $retval
        !            38: }
        !            39:
        !            40: stop() {
        !            41:     echo -n $"Stopping $prog: "
        !            42:     killproc $prog
        !            43:     retval=$?
        !            44:     echo
        !            45:     [ $retval -eq 0 ] && rm -f $lockfile
        !            46:     return $retval
        !            47: }
        !            48:
        !            49: restart() {
        !            50:     stop
        !            51:     start
        !            52: }
        !            53:
        !            54: reload() {
        !            55:     restart
        !            56: }
        !            57:
        !            58: force_reload() {
        !            59:     restart
        !            60: }
        !            61:
        !            62: fdr_status() {
        !            63:     status $prog
        !            64: }
        !            65:
        !            66: case "$1" in
        !            67:     start|stop|restart|reload)
        !            68:         $1
        !            69:         ;;
        !            70:     force-reload)
        !            71:         force_reload
        !            72:         ;;
        !            73:     status)
        !            74:         fdr_status
        !            75:         ;;
        !            76:     condrestart|try-restart)
        !            77:     [ ! -f $lockfile ] || restart
        !            78:       ;;
        !            79:     *)
        !            80:         echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
        !            81:         exit 2
        !            82: 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