Replace LEGACY_RESTART with RESTART

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2015-10-12 11:45:58 -07:00
parent bb538a7c10
commit 72d4637c22
12 changed files with 35 additions and 23 deletions

View File

@ -601,11 +601,13 @@ our %validlevels; # Valid log levels.
# Deprecated options with their default values # Deprecated options with their default values
# #
our %deprecated = ( our %deprecated = (
LEGACY_RESTART => 'no'
); );
# #
# Deprecated options that are eliminated via update # Deprecated options that are eliminated via update
# #
our %converted = ( our %converted = (
LEGACY_RESTART => 1
); );
# #
# Eliminated options # Eliminated options
@ -858,6 +860,7 @@ sub initialize( $;$$) {
BASIC_FILTERS => undef, BASIC_FILTERS => undef,
WORKAROUNDS => undef , WORKAROUNDS => undef ,
LEGACY_RESTART => undef , LEGACY_RESTART => undef ,
RESTART => undef ,
# #
# Packet Disposition # Packet Disposition
# #
@ -4863,6 +4866,7 @@ sub update_config_file( $ ) {
update_default( 'USE_DEFAULT_RT', 'No' ); update_default( 'USE_DEFAULT_RT', 'No' );
update_default( 'EXPORTMODULES', 'No' ); update_default( 'EXPORTMODULES', 'No' );
update_default( 'RESTART', 'reload' );
my $fn; my $fn;
@ -5759,7 +5763,15 @@ sub get_configuration( $$$$ ) {
default_yes_no 'INLINE_MATCHES' , ''; default_yes_no 'INLINE_MATCHES' , '';
default_yes_no 'BASIC_FILTERS' , ''; default_yes_no 'BASIC_FILTERS' , '';
default_yes_no 'WORKAROUNDS' , 'Yes'; default_yes_no 'WORKAROUNDS' , 'Yes';
default_yes_no 'LEGACY_RESTART' , '';
if ( supplied( $val = $config{RESTART} ) ) {
fatal_error "Invalid value for RESTART ($val)" unless $val =~ /^(restart|reload)$/;
} elsif (supplied $config{LEGACY_RESTART} ) {
default_yes_no 'LEGACY_RESTART' , 'Yes';
$config{RESTART} = $config{LEGACY_RESTART} ? 'reload' : 'restart';
} else {
$config{RESTART} = 'reload';
}
require_capability( 'BASIC_EMATCH', 'BASIC_FILTERS=Yes', 's' ) if $config{BASIC_FILTERS}; require_capability( 'BASIC_EMATCH', 'BASIC_FILTERS=Yes', 's' ) if $config{BASIC_FILTERS};
@ -6302,7 +6314,7 @@ sub generate_aux_config() {
emit "#\n# Shorewall auxiliary configuration file created by Shorewall version $globals{VERSION} - $date\n#"; emit "#\n# Shorewall auxiliary configuration file created by Shorewall version $globals{VERSION} - $date\n#";
for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS LEGACY_RESTART) ) { for my $option ( qw(VERBOSITY LOGFILE LOGFORMAT ARPTABLES IPTABLES IP6TABLES IP TC IPSET PATH SHOREWALL_SHELL SUBSYSLOCK LOCKFILE RESTOREFILE WORKAROUNDS RESTART) ) {
conditionally_add_option $option; conditionally_add_option $option;
} }

View File

@ -310,7 +310,7 @@ case "$COMMAND" in
restart) restart)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -z "$LEGACY_RESTART" ]; then if [ "$RESTART" = restart ]; then
COMMAND=stop stop_command && COMMAND=start start_command COMMAND=stop stop_command && COMMAND=start start_command
else else
COMMAND=reload COMMAND=reload

View File

@ -176,8 +176,6 @@ KEEP_RT_TABLES=No
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
LEGACY_RESTART=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
MACLIST_TTL= MACLIST_TTL=
@ -204,6 +202,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=Yes REQUIRE_INTERFACE=Yes
RESTART=restart
RESTORE_DEFAULT_ROUTE=Yes RESTORE_DEFAULT_ROUTE=Yes
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes

View File

@ -187,8 +187,6 @@ KEEP_RT_TABLES=No
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
LEGACY_RESTART=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
MACLIST_TTL= MACLIST_TTL=
@ -215,6 +213,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_DEFAULT_ROUTE=Yes RESTORE_DEFAULT_ROUTE=Yes
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes

View File

@ -184,8 +184,6 @@ KEEP_RT_TABLES=No
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
LEGACY_RESTART=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
MACLIST_TTL= MACLIST_TTL=
@ -212,6 +210,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_DEFAULT_ROUTE=Yes RESTORE_DEFAULT_ROUTE=Yes
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes

View File

@ -187,8 +187,6 @@ KEEP_RT_TABLES=No
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
LEGACY_RESTART=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
MACLIST_TTL= MACLIST_TTL=
@ -215,6 +213,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_DEFAULT_ROUTE=Yes RESTORE_DEFAULT_ROUTE=Yes
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes

View File

@ -174,8 +174,6 @@ IP_FORWARDING=On
KEEP_RT_TABLES=No KEEP_RT_TABLES=No
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -204,6 +202,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_DEFAULT_ROUTE=Yes RESTORE_DEFAULT_ROUTE=Yes
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes

View File

@ -163,8 +163,6 @@ IP_FORWARDING=Off
KEEP_RT_TABLES=Yes KEEP_RT_TABLES=Yes
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -187,6 +185,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=Yes REQUIRE_INTERFACE=Yes
RESTART=restart
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No SAVE_IPSETS=No

View File

@ -164,8 +164,6 @@ IP_FORWARDING=Off
KEEP_RT_TABLES=Yes KEEP_RT_TABLES=Yes
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -188,6 +186,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No SAVE_IPSETS=No

View File

@ -163,8 +163,6 @@ IP_FORWARDING=On
KEEP_RT_TABLES=Yes KEEP_RT_TABLES=Yes
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -187,6 +185,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No SAVE_IPSETS=No

View File

@ -163,8 +163,6 @@ IP_FORWARDING=On
KEEP_RT_TABLES=Yes KEEP_RT_TABLES=Yes
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -187,6 +185,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No SAVE_IPSETS=No

View File

@ -163,8 +163,6 @@ IP_FORWARDING=Off
KEEP_RT_TABLES=Yes KEEP_RT_TABLES=Yes
LEGACY_RESTART=Yes
LOAD_HELPERS_ONLY=Yes LOAD_HELPERS_ONLY=Yes
MACLIST_TABLE=filter MACLIST_TABLE=filter
@ -187,6 +185,8 @@ REJECT_ACTION=
REQUIRE_INTERFACE=No REQUIRE_INTERFACE=No
RESTART=restart
RESTORE_ROUTEMARKS=Yes RESTORE_ROUTEMARKS=Yes
SAVE_IPSETS=No SAVE_IPSETS=No