- Permit init scripts to run and load modules even if /etc/scst.conf doesn't yet exist.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Mark Buechler
2010-11-17 14:51:57 +00:00
parent 1633190a4a
commit 5e5478ecae
2 changed files with 20 additions and 13 deletions

View File

@@ -49,7 +49,6 @@ SCST_MODULES="scst scst_disk scst_vdisk"
#
[ -x "$(which scstadmin)" ] || exit 5
[ -f $SCST_CFG ] || exit 6
. /lib/lsb/init-functions
@@ -65,12 +64,16 @@ case "$1" in
fi
done
if scstadmin -config $SCST_CFG >/dev/null 2>&1; then
log_success_msg
else
log_failure_msg
exit 1
if [ -f $SCST_CFG ]; then
if scstadmin -config $SCST_CFG >/dev/null 2>&1; then
log_success_msg
else
log_failure_msg
exit 1
fi
fi
log_success_msg
;;
stop)
## Stop the service.

View File

@@ -50,7 +50,6 @@ SCST_MODULES="scst scst_disk scst_vdisk"
checkconfig() {
if [ ! -f $SCST_CFG ] ; then
eerror "Please create $SCST_CFG"
eerror "Do touch $SCST_CFG, and run scstadmin"
return 1
fi
return 0
@@ -67,7 +66,7 @@ checkinstall() {
start() {
ebegin "Loading and configuring the mid-level SCSI target SCST"
eindent
checkconfig || return $?
checkconfig
checkinstall || return $?
ret=0
for module in ${SCST_MODULES}; do
@@ -80,11 +79,16 @@ start() {
done
einfo "Configuring SCST..."
eindent
if scstadmin -config $SCST_CFG >/dev/null 2>&1; then
einfo "SCST config was loaded"
else
eend $? "SCST config could not be loaded"
return $?
if [ -f $SCST_CFG ]; then
if scstadmin -config $SCST_CFG >/dev/null 2>&1; then
einfo "SCST config was loaded"
else
eend $? "SCST config could not be loaded"
return $?
fi
else
einfo "SCST configuration file $SCST_CFG missing, skipping"
return 0
fi
eoutdent
eoutdent