summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakxservices
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-12-28 23:52:57 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-12-28 23:52:57 +0000
commitfcef7c0af0b51e7883fe6f78db5ab6f03be8000a (patch)
tree8321e6fa768420567bb3bcc06d18730b376facac /perl-install/standalone/drakxservices
parent55a6953f8ce1b586d8128feaa1a1e08c9f9beb03 (diff)
downloaddrakx-fcef7c0af0b51e7883fe6f78db5ab6f03be8000a.tar
drakx-fcef7c0af0b51e7883fe6f78db5ab6f03be8000a.tar.gz
drakx-fcef7c0af0b51e7883fe6f78db5ab6f03be8000a.tar.bz2
drakx-fcef7c0af0b51e7883fe6f78db5ab6f03be8000a.tar.xz
drakx-fcef7c0af0b51e7883fe6f78db5ab6f03be8000a.zip
no_comment
Diffstat (limited to 'perl-install/standalone/drakxservices')
-rwxr-xr-xperl-install/standalone/drakxservices15
1 files changed, 13 insertions, 2 deletions
diff --git a/perl-install/standalone/drakxservices b/perl-install/standalone/drakxservices
index 58f0c39e3..c463308da 100755
--- a/perl-install/standalone/drakxservices
+++ b/perl-install/standalone/drakxservices
@@ -2,8 +2,9 @@
use lib qw(/usr/lib/libDrakX);
-use common qw(:common :functional);
+use common qw(:common :functional :file);
use interactive;
+use log;
local $_ = join '', @ARGV;
@@ -23,7 +24,17 @@ _("Choose which services should be automatically started at boot time"),
mapn {
my ($name, $before, $after) = @_;
if ($before != $after) {
- system("chkconfig", $after ? "--add" : "--del", $name);
+ if ($after) {
+ if (cat_("/etc/rc.d/init.d/$name") =~ /^chkconfig:\s+-/m) {
+ system("chkconfig --add $name");
+ } else {
+ `/sbin/runlevel` =~ /\s(\d+)/ or die "bad runlevel";
+ $1 == 3 || $1 == 5 or log::l("strange runlevel: ``$1'' (neither 3 nor 5)");
+ system("chkconfig --level $1 $name on");
+ }
+ } else {
+ system("chkconfig --del $name");
+ }
}
} \@l, \@before, $after if $after;