Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2:ARM
iscsitarget
iscsitarget.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File iscsitarget.init of Package iscsitarget
#!/bin/sh # # /etc/init.d/iscsitarget # ### BEGIN INIT INFO # Provides: iscsitarget # Required-Start: $remote_fs $network # Should-Start: # Required-Stop: $remote_fs $network # Should-Stop: # Default-Start: 3 5 # Default-Stop: # Short-Description: iSCSI target daemon # Description: # Script to start and stop the iSCSI target daemon ### END INIT INFO CONFIG=/etc/ietd.conf PIDFILE=/var/run/iscsi_trgt.pid # Check for missing binaries (stale symlinks should not happen) # Note: Special treatment of stop for LSB conformance DAEMON=/usr/sbin/ietd test -x $DAEMON || { echo "$DAEMON not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } # Check for existence of needed config file and read it SYSCONFIG=/etc/sysconfig/ietd test -r $SYSCONFIG || { echo "$SYSCONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } # Read config . $SYSCONFIG # some defaults OPTS=${IETD_OPTS:=""} # Source LSB init functions . /etc/rc.status # Reset status of this service rc_reset PATH=/sbin:/bin:/usr/sbin:/usr/bin MEM_SIZE=1048576 configure_memsize() { if [ -e /proc/sys/net/core/wmem_max ]; then echo ${MEM_SIZE} > /proc/sys/net/core/wmem_max fi if [ -e /proc/sys/net/core/rmem_max ]; then echo ${MEM_SIZE} > /proc/sys/net/core/rmem_max fi if [ -e /proc/sys/net/core/wmem_default ]; then echo ${MEM_SIZE} > /proc/sys/net/core/wmem_default fi if [ -e /proc/sys/net/core/rmem_default ]; then echo ${MEM_SIZE} > /proc/sys/net/core/rmem_default fi if [ -e /proc/sys/net/ipv4/tcp_mem ]; then echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_mem fi if [ -e /proc/sys/net/ipv4/tcp_rmem ]; then echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_rmem fi if [ -e /proc/sys/net/ipv4/tcp_wmem ]; then echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_wmem fi } case "$1" in start) echo -n "Starting iSCSI target service: " configure_memsize modprobe -q crc32c modprobe iscsi_trgt ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. /sbin/startproc -p $PIDFILE $DAEMON "$OPTS" # Remember status and be verbose rc_status -v ;; stop) echo -n "Stopping iSCSI target service: " ## Stop daemon with killproc(8) and if this fails ## killproc sets the return value according to LSB. ietadm --op delete >/dev/null 2>/dev/null /sbin/killproc -p $PIDFILE -TERM $DAEMON modprobe -r iscsi_trgt 2>/dev/null RETVAL=$? modprobe -r crc32c 2>/dev/null if [ $RETVAL != "0" ]; then rc_failed fi # Remember status and be verbose rc_status -v ;; restart|reload) ## Stop the service and regardless of whether it was ## running or not, start it again. $0 stop $0 start # Remember status and be quiet rc_status ;; status) echo -n "Checking for iSCSI target service" ## Check status with checkproc(8), if process is running ## checkproc will return with exit status 0. /sbin/checkproc -p $PIDFILE $DAEMON # Remember status and be verbose rc_status -v ;; *) echo $"Usage: $0 {start|stop|restart|status}" exit 1 esac rc_exit
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor