More error logging

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5107 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-12 16:16:30 +00:00
parent 109cdc0902
commit 626e0c577f
3 changed files with 13 additions and 3 deletions

View File

@ -48,7 +48,7 @@ fatal_error() # $* = Error Message
} }
# #
# We include this for compatibility with the 'firewall' script. It distinguishes between # We include this for compatibility with the 'firewall' script. That script distinguishes between
# Fatal Errors (stop or restore required) and Startup Errors (errors detected before the firewall # Fatal Errors (stop or restore required) and Startup Errors (errors detected before the firewall
# state has been changed. This allows us to use common parsing routines in both programs. # state has been changed. This allows us to use common parsing routines in both programs.
# #

View File

@ -765,7 +765,14 @@ restore_command() {
fi fi
progress_message3 "Restoring Shorewall..." progress_message3 "Restoring Shorewall..."
$SHOREWALL_SHELL $RESTOREPATH restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
if $SHOREWALL_SHELL $RESTOREPATH restore; then
progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
logger "$PRODUCT restored"
else
logger "ERROR:$PRODUCT restore failed"
fi
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
else else
echo "File ${VARDIR}/$RESTOREFILE: file not found" echo "File ${VARDIR}/$RESTOREFILE: file not found"

View File

@ -237,6 +237,7 @@ start_command() {
fi fi
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
[ $rc -ne 0 ] && logger "ERROR: Shorewall start failed"
exit $rc exit $rc
} }
@ -331,6 +332,7 @@ start_command() {
$SHOREWALL_SHELL $RESTOREPATH restore $SHOREWALL_SHELL $RESTOREPATH restore
date > ${VARDIR}/restarted date > ${VARDIR}/restarted
progress_message3 Shorewall restored from $RESTOREPATH progress_message3 Shorewall restored from $RESTOREPATH
logger "Shorewall restored"
else else
do_it do_it
fi fi
@ -553,6 +555,7 @@ restart_command() {
fi fi
[ -n "$nolock" ] || mutex_off [ -n "$nolock" ] || mutex_off
[ $rc -ne 0 ] && logger "ERROR: Shorewall restart failed"
return $rc return $rc
} }
@ -1502,7 +1505,7 @@ case "$COMMAND" in
;; ;;
restore) restore)
shift shift
restore_command $@ r estore_command $@
;; ;;
call) call)
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x