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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 , USE_DEFAULT_RT => undef ,
RESTORE_DEFAULT_ROUTE => undef , RESTORE_DEFAULT_ROUTE => undef ,
FAST_STOP => undef , FAST_STOP => undef ,
AUTOMAKE => undef ,
# #
# Packet Disposition # Packet Disposition
# #
@ -526,6 +527,7 @@ sub initialize( $ ) {
DONT_LOAD => '', DONT_LOAD => '',
AUTO_COMMENT => undef, AUTO_COMMENT => undef,
MANGLE_ENABLED => undef , MANGLE_ENABLED => undef ,
AUTOMAKE => undef ,
# #
# Packet Disposition # Packet Disposition
# #
@ -2259,6 +2261,7 @@ sub get_configuration( $ ) {
default_yes_no 'NULL_ROUTE_RFC1918' , ''; default_yes_no 'NULL_ROUTE_RFC1918' , '';
default_yes_no 'USE_DEFAULT_RT' , ''; default_yes_no 'USE_DEFAULT_RT' , '';
default_yes_no 'RESTORE_DEFAULT_ROUTE' , 'Yes'; default_yes_no 'RESTORE_DEFAULT_ROUTE' , 'Yes';
default_yes_no 'AUTOMAKE' , '';
$capabilities{XCONNMARK} = '' unless $capabilities{XCONNMARK_MATCH} and $capabilities{XMARK}; $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. 6) Use iptables[6]-restore to stop the firewall.
7) Add AUTOMAKE option
Changes in Shorewall 4.3.7 Changes in Shorewall 4.3.7
1) Fix forward treatment of interface options. 1) Fix forward treatment of interface options.

View File

@ -190,6 +190,8 @@ RESTORE_DEFAULT_ROUTE=Yes
FAST_STOP=No FAST_STOP=No
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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 consequence, the 'critical' option in /etc/shorewall/route_stopped
is no longer needed and will result in a warning. 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 N E W F E A T U R E S IN 4 . 3
---------------------------------------------------------------------------- ----------------------------------------------------------------------------

View File

@ -323,6 +323,20 @@ get_config() {
fi fi
;; ;;
esac 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,6 +407,12 @@ start_command() {
local rc local rc
rc=0 rc=0
if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/.start $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
progress_message3 "Compiling..." progress_message3 "Compiling..."
if compiler $debugging $nolock compile ${VARDIR}/.start; then if compiler $debugging $nolock compile ${VARDIR}/.start; then
@ -404,6 +424,7 @@ start_command() {
rc=$? rc=$?
logger -p kern.err "ERROR:Shorewall start failed" logger -p kern.err "ERROR:Shorewall start failed"
fi fi
fi
exit $rc exit $rc
} }
@ -478,16 +499,28 @@ start_command() {
export NOROUTES export NOROUTES
export PURGE export PURGE
if [ -n "$FAST" ]; then if [ -n "${FAST}${AUTOMAKE}" ]; then
if qt mywhich make; then if qt mywhich make; then
# #
# RESTOREFILE is exported by get_config() # 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 fi
if [ -n "$FAST" ]; then if [ -n "$FAST" ]; then
RESTOREPATH=${VARDIR}/$RESTOREFILE RESTOREPATH=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then if [ -x $RESTOREPATH ]; then

View File

@ -296,6 +296,20 @@ get_config() {
fi fi
;; ;;
esac 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,6 +395,12 @@ start_command() {
local rc local rc
rc=0 rc=0
if [ -n "$AUTOMAKE" ]; then
[ -n "$nolock" ] || mutex_on
${VARDIR}/firewall $debugging start
rc=$?
[ -n "$nolock" ] || mutex_off
else
progress_message3 "Compiling..." progress_message3 "Compiling..."
if compiler run $debugging $nolock compile ${VARDIR}/.start; then if compiler run $debugging $nolock compile ${VARDIR}/.start; then
@ -392,6 +412,7 @@ start_command() {
rc=$? rc=$?
logger -p kern.err "ERROR:Shorewall6 start failed" logger -p kern.err "ERROR:Shorewall6 start failed"
fi fi
fi
exit $rc exit $rc
} }
@ -466,16 +487,28 @@ start_command() {
export NOROUTES export NOROUTES
export PURGE export PURGE
if [ -n "$FAST" ]; then if [ -n "${FAST}${AUTOMAKE}" ]; then
if qt mywhich make; then if qt mywhich make; then
# #
# RESTOREFILE is exported by get_config() # 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 fi
if [ -n "$FAST" ]; then if [ -n "$FAST" ]; then
RESTOREPATH=${VARDIR}/$RESTOREFILE RESTOREPATH=${VARDIR}/$RESTOREFILE
if [ -x $RESTOREPATH ]; then if [ -x $RESTOREPATH ]; then

View File

@ -135,6 +135,8 @@ AUTO_COMMENT=Yes
MANGLE_ENABLED=Yes MANGLE_ENABLED=Yes
AUTOMAKE=No
############################################################################### ###############################################################################
# P A C K E T D I S P O S I T I O N # 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> role="bold">Yes</emphasis>|<emphasis role="bold">No</emphasis>]</term>
<listitem> <listitem>
<para>Added in Shorewall-perl 4.1.5. If set, if there is not a <para>If set, if there is not a current comment when a macro is
current comment when a macro is invoked, the behavior is as if the invoked, the behavior is as if the first line of the macro file was
first line of the macro file was "COMMENT &lt;macro name&gt;". The "COMMENT &lt;macro name&gt;". The AUTO_COMMENT option has a default
AUTO_COMMENT option has a default value of 'Yes'.</para> 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> </listitem>
</varlistentry> </varlistentry>

View File

@ -203,6 +203,21 @@
</listitem> </listitem>
</varlistentry> </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> <varlistentry>
<term><emphasis <term><emphasis
role="bold">BLACKLIST_DISPOSITION=</emphasis>[<emphasis role="bold">BLACKLIST_DISPOSITION=</emphasis>[<emphasis