mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix to restart dependent services with firewalld
https://forum.virtualmin.com/t/virtualmin-fail2ban-firewalld-ubuntu-20-04-not-working-already-banned-until-restart/116565/4?u=ilia
This commit is contained in:
@@ -234,6 +234,7 @@ sub apply_firewalld
|
||||
{
|
||||
&foreign_require("init");
|
||||
my ($ok, $err) = &init::restart_action($config{'init_name'});
|
||||
&restart_firewalld_dependent();
|
||||
return $ok ? undef : $err;
|
||||
}
|
||||
|
||||
@@ -252,9 +253,24 @@ sub start_firewalld
|
||||
{
|
||||
&foreign_require("init");
|
||||
my ($ok, $err) = &init::start_action($config{'init_name'});
|
||||
&restart_firewalld_dependent();
|
||||
return $ok ? undef : $err;
|
||||
}
|
||||
|
||||
# restart_firewalld_dependent()
|
||||
# Restarts dependent services
|
||||
sub restart_firewalld_dependent
|
||||
{
|
||||
if (&foreign_exists("fail2ban")) {
|
||||
&foreign_require("fail2ban");
|
||||
if (&fail2ban::is_fail2ban_running()) {
|
||||
my $err = &fail2ban::restart_fail2ban_server(1);
|
||||
&error(&text('index_dependent', 'fail2ban'))
|
||||
if ($err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# list_system_interfaces()
|
||||
# Returns the list of all interfaces on the system
|
||||
sub list_system_interfaces
|
||||
|
||||
@@ -37,6 +37,7 @@ index_listrules=List FirewallD Rules
|
||||
index_restart_firewalld=Reload FirewallD
|
||||
index_restart_firewallddesc=Reload the FirewallD server and apply the rules that were permanently created.
|
||||
index_listrules_restartdesc=List details about existing rich and direct FirewallD rules in $1 zone.
|
||||
index_dependent=Failed to restart $1 dependent service
|
||||
|
||||
port_edit=Edit Port
|
||||
port_create=Add Port
|
||||
|
||||
Reference in New Issue
Block a user