mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
- 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:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user