Skip to content

Commit

Permalink
Avoid DhcpServer Perl module to overlap with Yast2::SystemService
Browse files Browse the repository at this point in the history
Despite services will be managed by Yast2::SystemService from now on, it
is necessary to keep the related Perl code for `auto` and `config` modes
until  them will be also managed from Ruby.
  • Loading branch information
dgdavid committed Aug 13, 2018
1 parent 0d326c4 commit 7acbe06
Showing 1 changed file with 28 additions and 25 deletions.
53 changes: 28 additions & 25 deletions src/modules/DhcpServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1745,32 +1745,35 @@ sub Write {
SCR->Write (".sysconfig.dhcpd.DHCPD_INTERFACE", $ifaces_list);
SCR->Write (".sysconfig.dhcpd.DHCPD_OTHER_ARGS", $other_options);
SCR->Write (".sysconfig.dhcpd", undef);


if ($start_service)
{
y2milestone ("Enabling the DHCP service");
my $ret = 1;
if (! $write_only)
{
$ret = Service->Restart ($SERVICE);
}
Service->Enable ($SERVICE);
if (!$ret)
{
# error report
Report->Error (__("Error occurred while restarting the DHCP daemon."));
$ok = 0;
}
}
else
{
y2milestone ("Disabling the DHCP service");
if (! $write_only)
{
Service->Stop ($SERVICE);
}
Service->Disable ($SERVICE);
# TODO: Manage the service directly through Yast2::SystemService instead
if (Mode->auto() || Mode->config())
{
if ($start_service)
{
y2milestone ("Enabling the DHCP service");
my $ret = 1;
if (! $write_only)
{
$ret = Service->Restart ($SERVICE);
}
Service->Enable ($SERVICE);
if (!$ret)
{
# error report
Report->Error (__("Error occurred while restarting the DHCP daemon."));
$ok = 0;
}
}
else
{
y2milestone ("Disabling the DHCP service");
if (! $write_only)
{
Service->Stop ($SERVICE);
}
Service->Disable ($SERVICE);
}
}

Progress->NextStage ();
Expand Down

0 comments on commit 7acbe06

Please sign in to comment.