summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-01-14 13:50:23 +0000
committerColin Guthrie <colin@mageia.org>2014-01-14 20:51:05 +0000
commit341ee9fe5e9810a8cc1a7d7156da0158f78dce68 (patch)
treedc8138e9ec90bf1d44547f9ebaaf93315fa4784c
parent2fcb32d7734ceb9e1aec503dbb3fe79a5f656375 (diff)
downloaddrakx-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.
-rw-r--r--perl-install/NEWS3
-rw-r--r--perl-install/install/NEWS4
-rw-r--r--perl-install/services.pm11
3 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 2f8650349..b25dbfd93 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,6 @@
+- services:
+ o use --no-block with chkconfig and systemctl enable to prevent systemd reload
+ and potential crash (especially during first/live boot)
- harddrake:
o fix detecting some wireless devices as scanners (mga#9895)
o fix random order of fields with perl-5.18
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 8956b2d8e..b38f65857 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,7 @@
+- services:
+ o use --no-block with chkconfig and systemctl enable to prevent systemd reload
+ and potential crash (especially during first/live boot)
+
Version 16.21 - 13 January 2014
- partitioning:
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");
}
}
}