From 837f977d6da723699a5cde923fa8d452c3ee8b3f Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 12 Dec 2006 17:49:52 +0000 Subject: [PATCH] More logging cleanup git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5114 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-lite/shorewall-lite | 4 ++-- Shorewall/compiler | 22 +++++++++++----------- Shorewall/firewall | 6 +++--- Shorewall/lib.cli | 7 +------ Shorewall/shorewall | 5 ++--- 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/Shorewall-lite/shorewall-lite b/Shorewall-lite/shorewall-lite index e3dc9167d..ff454955a 100755 --- a/Shorewall-lite/shorewall-lite +++ b/Shorewall-lite/shorewall-lite @@ -188,11 +188,11 @@ start_command() { rc=$? else error_message "${LITEDIR}/firewall is missing or is not executable" + logger -p kern.err "ERROR:Shorewall Lite start failed" rc=2 fi [ -n "$nolock" ] || mutex_off - [ $rc -eq 0 ] || logger "ERROR:Shorewall Lite start failed" exit $rc } @@ -363,11 +363,11 @@ restart_command() { rc=$? else error_message "${LITEDIR}/firewall is missing or is not executable" + logger -p kern.err "ERROR:Shorewall Lite restart failed" rc=2 fi [ -n "$nolock" ] || mutex_off - [ $rc -eq 0 ] || logger "ERROR:Shorewall Lite restart failed" return $rc } diff --git a/Shorewall/compiler b/Shorewall/compiler index e2432316d..f2b8f664a 100755 --- a/Shorewall/compiler +++ b/Shorewall/compiler @@ -4462,13 +4462,13 @@ stop_firewall() { case \$COMMAND in start) - logger "Shorewall start failed" + logger -p kern.err "ERROR:\$PRODUCT start failed" ;; restart) - logger "Shorewall restart failed" + logger -p kern.err "ERROR:\$PRODUCT restart failed" ;; restore) - logger "Shorewall restore failed" + logger -p kern.err "ERROR:\$PRODUCT restore failed" ;; esac @@ -4691,7 +4691,7 @@ __EOF__ set_state "Stopped" - logger "Shorewall Stopped" + logger -p kern.info "\$PRODUCT Stopped" case \$COMMAND in stop|clear) @@ -4887,7 +4887,7 @@ __EOF__ set_state "Cleared" - logger "\$PRODUCT Cleared" + logger -p kern.info "\$PRODUCT Cleared" } # @@ -4908,13 +4908,13 @@ startup_error() # \$* = Error Message echo " ERROR: \$@" >&2 case \$COMMAND in start) - logger "Shorewall start failed" + logger -p kern.err "ERROR:\$PRODUCT start failed" ;; restart) - logger "Shorewall restart failed" + logger -p kern.err "ERROR:\$PRODUCT restart failed" ;; restore) - logger "Shorewall restore failed" + logger -p kern.err "ERROR:\$PRODUCT restore failed" ;; esac @@ -5480,13 +5480,13 @@ __EOF__ case \$COMMAND in start) - logger "Shorewall started" + logger -p kern.info "\$PRODUCT started" ;; restart) - logger "Shorewall restarted" + logger -p kern.info "\$PRODUCT restarted" ;; restore) - logger "Shorewall restored" + logger -p kern.info "\$PRODUCT restored" ;; esac diff --git a/Shorewall/firewall b/Shorewall/firewall index 10fb676df..48c97e93d 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -81,7 +81,7 @@ startup_error() # $* = Error Message # report () { # $* = message progress_message3 "$@" - logger "$@" + logger -p kern.info "$@" } # @@ -391,7 +391,7 @@ stop_firewall() { set_state "Stopped" - logger "Shorewall Stopped" + logger -p kern.info "Shorewall Stopped" rm -rf $TMP_DIR @@ -434,7 +434,7 @@ clear_firewall() { set_state "Cleared" - logger "Shorewall Cleared" + logger -p kern.info "Shorewall Cleared" } # diff --git a/Shorewall/lib.cli b/Shorewall/lib.cli index 34e94e3b2..52fa8908a 100644 --- a/Shorewall/lib.cli +++ b/Shorewall/lib.cli @@ -766,12 +766,7 @@ restore_command() { progress_message3 "Restoring Shorewall..." - if $SHOREWALL_SHELL $RESTOREPATH restore; then - progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE" - logger "$PRODUCT restored" - else - logger "ERROR:$PRODUCT restore failed" - fi + $SHOREWALL_SHELL $RESTOREPATH restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE" [ -n "$nolock" ] || mutex_off else diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 74b50fbc2..fe2da6f07 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -233,11 +233,11 @@ start_command() { ${VARDIR}/.start $debugging start rc=$? else + logger -p kern.err "ERROR:Shorewall start failed" rc=$? fi [ -n "$nolock" ] || mutex_off - [ $rc -ne 0 ] && logger "ERROR: Shorewall start failed" exit $rc } @@ -332,7 +332,6 @@ start_command() { $SHOREWALL_SHELL $RESTOREPATH restore date > ${VARDIR}/restarted progress_message3 Shorewall restored from $RESTOREPATH - logger "Shorewall restored" else do_it fi @@ -551,11 +550,11 @@ restart_command() { $SHOREWALL_SHELL ${VARDIR}/.restart $debugging restart rc=$? else + logger -p kern.err "ERROR:Shorewall restart failed" rc=$? fi [ -n "$nolock" ] || mutex_off - [ $rc -ne 0 ] && logger "ERROR: Shorewall restart failed" return $rc }