28 |
use MDK::Wizard::IFCFG; |
use MDK::Wizard::IFCFG; |
29 |
|
|
30 |
our @ISA = qw(Exporter); |
our @ISA = qw(Exporter); |
31 |
our @EXPORT = qw(check_started check_starts_on_boot test_host_domain); |
our @EXPORT = qw(check_started check_starts_on_boot test_host_domain reload_or_restart); |
32 |
|
|
33 |
sub check_dhcp { |
sub check_dhcp { |
34 |
my ($wiz) = @_; |
my ($wiz) = @_; |
48 |
return 'error_end' if !$isrunning; |
return 'error_end' if !$isrunning; |
49 |
} |
} |
50 |
|
|
51 |
|
sub reload_or_restart { |
52 |
|
my ($service) = @_; |
53 |
|
if (run_program::rooted($::prefix, '/bin/mountpoint', '-q', '/sys/fs/cgroup/systemd')) { |
54 |
|
run_program::rooted($::prefix, '/bin/systemctl', 'reload-or-restart', "$service.service"); |
55 |
|
} else { |
56 |
|
run_program::rooted($::prefix, "/etc/rc.d/init.d/$service", "restart"); |
57 |
|
} |
58 |
|
} |
59 |
|
|
60 |
sub check_starts_on_boot($$) { |
sub check_starts_on_boot($$) { |
61 |
my ($in, $servicename) = @_; |
my ($in, $servicename) = @_; |
62 |
if (!services::starts_on_boot($servicename)) { |
if (!services::starts_on_boot($servicename)) { |