From fcef7c0af0b51e7883fe6f78db5ab6f03be8000a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 28 Dec 1999 23:52:57 +0000 Subject: no_comment --- perl-install/standalone/drakxservices | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'perl-install/standalone/drakxservices') 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; -- cgit v1.2.1