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 7, 2018
1 parent ae3610f commit 0e85667
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions src/modules/DhcpServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1745,32 +1745,34 @@ 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);
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 0e85667

Please sign in to comment.