diff options
author | Colin Guthrie <colin@mageia.org> | 2014-01-14 13:50:23 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-01-14 20:51:05 +0000 |
commit | 341ee9fe5e9810a8cc1a7d7156da0158f78dce68 (patch) | |
tree | dc8138e9ec90bf1d44547f9ebaaf93315fa4784c /perl-install/services.pm | |
parent | 2fcb32d7734ceb9e1aec503dbb3fe79a5f656375 (diff) | |
download | drakx-341ee9fe5e9810a8cc1a7d7156da0158f78dce68.tar drakx-341ee9fe5e9810a8cc1a7d7156da0158f78dce68.tar.gz drakx-341ee9fe5e9810a8cc1a7d7156da0158f78dce68.tar.bz2 drakx-341ee9fe5e9810a8cc1a7d7156da0158f78dce68.tar.xz drakx-341ee9fe5e9810a8cc1a7d7156da0158f78dce68.zip |
services.pm: Use no-reload mode when interacting with systemd.
Basically, there seems to be an issue right now if we do lots of reloads.
It seems to be somewhat racy and systemd gets generally confused when we
do this during boot (which we do) and trigger a reload. The reload isn't
strictly needed, as we do also explicitly start the services we enable
(with --no-block so that we don't cause a deadlock) so all *should* be
99% OK. Using it at runtime might mean we don't have fully up-to-date
enablement status, but being able to boot wins at the moment.
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r-- | perl-install/services.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm index 7805f0141..7d90acc2d 100644 --- a/perl-install/services.pm +++ b/perl-install/services.pm @@ -284,8 +284,11 @@ sub _set_service { my @xinetd_services = map { $_->[0] } xinetd_services(); + # General Note: We use --no-reload here as this code is sometimes triggered + # from code at boot and reloading systemd during boot is generally a bit + # racy just now it seems. if (member($service, @xinetd_services)) { - run_program::rooted($::prefix, "chkconfig", $enable ? "--add" : "--del", $service); + run_program::rooted($::prefix, "chkconfig", "--no-reload", $enable ? "--add" : "--del", $service); # Probably still a bug here as xinet support in chkconfig shells out to /sbin/service.... } elsif (running_systemd() || has_systemd()) { # systemctl rejects any symlinked units. You have to enabled the real file if (-l "/lib/systemd/system/$service.service") { @@ -293,13 +296,13 @@ sub _set_service { } else { $service = $service . ".service"; } - run_program::rooted($::prefix, "/bin/systemctl", $enable ? "enable" : "disable", $service); + run_program::rooted($::prefix, "/bin/systemctl", $enable ? "enable" : "disable", "--no-reload", $service); } else { my $script = "/etc/rc.d/init.d/$service"; - run_program::rooted($::prefix, "chkconfig", $enable ? "--add" : "--del", $service); + run_program::rooted($::prefix, "chkconfig", "--no-reload", $enable ? "--add" : "--del", $service); #- FIXME: handle services with no chkconfig line and with no Default-Start levels in LSB header if ($enable && cat_("$::prefix$script") =~ /^#\s+chkconfig:\s+-/m) { - run_program::rooted($::prefix, "chkconfig", "--level", "35", $service, "on"); + run_program::rooted($::prefix, "chkconfig", "--no-reload", "--level", "35", $service, "on"); } } } |