Add AUTOMAKE option

Signed-off-by: Tom Eastep <teastep@shorewall.net>

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9767 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2009-03-31 17:31:23 +00:00
parent 22526979db
commit 6c205d922a
15 changed files with 149 additions and 21 deletions

View File

@ -184,6 +184,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -186,6 +186,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -186,6 +186,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -135,6 +135,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -135,6 +135,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -135,6 +135,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -426,6 +426,7 @@ sub initialize( $ ) {
USE_DEFAULT_RT => undef ,
RESTORE_DEFAULT_ROUTE => undef ,
FAST_STOP => undef ,
AUTOMAKE => undef ,
#
# Packet Disposition
#
@ -526,6 +527,7 @@ sub initialize( $ ) {
DONT_LOAD => '',
AUTO_COMMENT => undef,
MANGLE_ENABLED => undef ,
AUTOMAKE => undef ,
#
# Packet Disposition
#
@ -2259,6 +2261,7 @@ sub get_configuration( $ ) {
default_yes_no 'NULL_ROUTE_RFC1918' , '';
default_yes_no 'USE_DEFAULT_RT' , '';
default_yes_no 'RESTORE_DEFAULT_ROUTE' , 'Yes';
default_yes_no 'AUTOMAKE' , '';
$capabilities{XCONNMARK} = '' unless $capabilities{XCONNMARK_MATCH} and $capabilities{XMARK};

View File

@ -12,6 +12,8 @@ Changes in Shorewall 4.3.8
6) Use iptables[6]-restore to stop the firewall.
7) Add AUTOMAKE option
Changes in Shorewall 4.3.7
1) Fix forward treatment of interface options.

View File

@ -190,6 +190,8 @@ RESTORE_DEFAULT_ROUTE=Yes
FAST_STOP=No
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -88,6 +88,17 @@ None.
consequence, the 'critical' option in /etc/shorewall/route_stopped
is no longer needed and will result in a warning.
5) A new AUTOMAKE option has been added to shorewall.conf and
shorewall6.conf. When set to 'Yes', this option causes new behavior
during processing of the 'start' command; if no files in
/etc/shorewall/ (/etc/shorewall6) have changed since the last
'start' or 'restart', then the compilation step is skipped and the
script used during the last 'start' or 'restart' is used to start
the firewall.
Note that the 'make' utility must be installed on the firewall
system in order for AUTOMAKE=Yes to work correctly.
----------------------------------------------------------------------------
N E W F E A T U R E S IN 4 . 3
----------------------------------------------------------------------------

View File

@ -323,6 +323,20 @@ get_config() {
fi
;;
esac
case $AUTOMAKE in
Yes|yes)
;;
No|no)
AUTOMAKE=
;;
*)
if [ -n "$AUTOMAKE" ]; then
echo " ERROR: Invalid AUTOMAKE setting ($AUTOMAKE)" >&2
exit 1
fi
;;
esac
}
#
@ -393,16 +407,23 @@ start_command() {
local rc
rc=0
progress_message3 "Compiling..."
if compiler $debugging $nolock compile ${VARDIR}/.start; then
if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/.start $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall start failed"
progress_message3 "Compiling..."
if compiler $debugging $nolock compile ${VARDIR}/.start; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/.start $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall start failed"
fi
fi
exit $rc
@ -478,16 +499,28 @@ start_command() {
export NOROUTES
export PURGE
if [ -n "$FAST" ]; then
if [ -n "${FAST}${AUTOMAKE}" ]; then
if qt mywhich make; then
#
# RESTOREFILE is exported by get_config()
#
make -qf ${CONFDIR}/Makefile || FAST=
if [ -z "$FAST" ]; then
#
# Autofast -- use the last compiled script
#
RESTOREFILE=firewall
fi
if ! make -qf ${CONFDIR}/Makefile; then
FAST=
AUTOMAKE=
fi
else
FAST=
AUTOMAKE=
fi
if [ -n "$FAST" ]; then
RESTOREPATH=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then

View File

@ -296,6 +296,20 @@ get_config() {
fi
;;
esac
case $AUTOMAKE in
Yes|yes)
;;
No|no)
AUTOMAKE=
;;
*)
if [ -n "$AUTOMAKE" ]; then
echo " ERROR: Invalid AUTOMAKE setting ($AUTOMAKE)" >&2
exit 1
fi
;;
esac
}
#
@ -381,16 +395,23 @@ start_command() {
local rc
rc=0
progress_message3 "Compiling..."
if compiler run $debugging $nolock compile ${VARDIR}/.start; then
if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/.start $debugging start
${VARDIR}/firewall $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall6 start failed"
progress_message3 "Compiling..."
if compiler run $debugging $nolock compile ${VARDIR}/.start; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/.start $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
rc=$?
logger -p kern.err "ERROR:Shorewall6 start failed"
fi
fi
exit $rc
@ -466,16 +487,28 @@ start_command() {
export NOROUTES
export PURGE
if [ -n "$FAST" ]; then
if [ -n "${FAST}${AUTOMAKE}" ]; then
if qt mywhich make; then
#
# RESTOREFILE is exported by get_config()
#
make -qf ${CONFDIR}/Makefile || FAST=
if [ -z "$FAST" ]; then
#
# Autofast -- use the last compiled script
#
RESTOREFILE=firewall
fi
if ! make -qf ${CONFDIR}/Makefile; then
FAST=
AUTOMAKE=
fi
else
FAST=
AUTOMAKE=
fi
if [ -n "$FAST" ]; then
RESTOREPATH=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then

View File

@ -135,6 +135,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes
AUTOMAKE=No
###############################################################################
# P A C K E T D I S P O S I T I O N
###############################################################################

View File

@ -248,10 +248,25 @@
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>Added in Shorewall-perl 4.1.5. If set, if there is not a
current comment when a macro is invoked, the behavior is as if the
first line of the macro file was "COMMENT &lt;macro name&gt;". The
AUTO_COMMENT option has a default value of 'Yes'.</para>
<para>If set, if there is not a current comment when a macro is
invoked, the behavior is as if the first line of the macro file was
"COMMENT &lt;macro name&gt;". The AUTO_COMMENT option has a default
value of 'Yes'.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">AUTOMAKE=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>If set, the behavior of the 'start' command is change; if no
files in /etc/shorewall have been changed since the last successful
<command>start</command> or <command>restart</command> command, then
the compilation step is skipped and the compiled script that
executed the last <command>start</command> or
<command>restart</command> command is used. The default is
AUTOMAKE=No.</para>
</listitem>
</varlistentry>

View File

@ -203,6 +203,21 @@
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis role="bold">AUTOMAKE=</emphasis>[<emphasis
role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem>
<para>If set, the behavior of the 'start' command is change; if no
files in /etc/shorewall have been changed since the last successful
<command>start</command> or <command>restart</command> command, then
the compilation step is skipped and the compiled script that
executed the last <command>start</command> or
<command>restart</command> command is used. The default is
AUTOMAKE=No.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><emphasis
role="bold">BLACKLIST_DISPOSITION=</emphasis>[<emphasis