Annotation of embedaddon/istgt/etc/istgt_linux.sh.in, revision 1.1.1.1

1.1       misho       1: #!/bin/sh
                      2: #
                      3: ### BEGIN INIT INFO
                      4: # Provides:       istgt
                      5: # Required-Start: $remote_fs $syslog $named
                      6: # Required-Stop:  $remote_fs $syslog
                      7: # Should-Start: network-remotefs
                      8: # Should-Stop: network-remotefs
                      9: # Default-Start:  3 5
                     10: # Default-Stop:   0 1 2 6
                     11: # Short-Description: Userspace iSCSI target daemon
                     12: # Description: Userspace iSCSI target daemon
                     13: ### END INIT INFO
                     14: 
                     15: . /etc/rc.status
                     16: rc_reset
                     17: 
                     18: name="istgt"
                     19: 
                     20: : ${istgt_config="%%SYSCONFDIR%%/istgt/istgt.conf"}
                     21: : ${istgt_pidfile="/var/run/istgt.pid"}
                     22: : ${istgt_flags=""}
                     23: 
                     24: required_files="${istgt_config}"
                     25: pidfile="${istgt_pidfile}"
                     26: command="%%SBINDIR%%/istgt"
                     27: command_args="-c ${istgt_config} ${istgt_flags}"
                     28: 
                     29: case "$1" in
                     30:        start)
                     31:                echo "Starting iSCSI target daemon (${name})"
                     32:                startproc $command $command_args
                     33:                rc_status -v
                     34:                ;;
                     35:        stop)
                     36:                echo "Shutting down iSCSI target daemon (${name})"
                     37:                killproc -p $istgt_pidfile -TERM $command
                     38:                rc_status -v
                     39:                rm -f $istgt_pidfile 2>/dev/null
                     40:                ;;
                     41:        restart)
                     42:                $0 stop
                     43:                $0 start
                     44:                rc_status
                     45:                ;;
                     46:        force-reload|reload)
                     47:                echo "Reloading iSCSI target daemon (${name})"
                     48:                killproc -p $istgt_pidfile -HUP $command
                     49:                rc_status -v
                     50:                ;;
                     51:        status)
                     52:                echo "Checking for iSCSI target daemon (${name})"
                     53:                checkproc -p $istgt_pidfile $command
                     54:                rc_status -v
                     55:                ;;
                     56:        *)
                     57:                echo "Usage: $0 {start|stop|restart|status}"
                     58:                exit 1
                     59:                ;;
                     60: esac
                     61: 
                     62: rc_exit

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