summaryrefslogtreecommitdiffstats
path: root/perl-install/services.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-02-24 15:39:23 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-02-24 15:39:23 +0000
commitaa9f06dc2d48164992bf98105b578c554b932065 (patch)
treeabb47bdf8bee1ef0281c5118294fa8b7c9642240 /perl-install/services.pm
parent38bfa050a240f47b1d585f5e117a281005c4606c (diff)
downloaddrakx-backup-do-not-use-aa9f06dc2d48164992bf98105b578c554b932065.tar
drakx-backup-do-not-use-aa9f06dc2d48164992bf98105b578c554b932065.tar.gz
drakx-backup-do-not-use-aa9f06dc2d48164992bf98105b578c554b932065.tar.bz2
drakx-backup-do-not-use-aa9f06dc2d48164992bf98105b578c554b932065.tar.xz
drakx-backup-do-not-use-aa9f06dc2d48164992bf98105b578c554b932065.zip
in standalone mode, only display a service as enabled at boot time
only if it's really enabled in current runlevel. what's more it's more coherent with other "only show current runlevel status" tools like ntsysv.
Diffstat (limited to 'perl-install/services.pm')
-rw-r--r--perl-install/services.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/services.pm b/perl-install/services.pm
index c41c14190..171020e32 100644
--- a/perl-install/services.pm
+++ b/perl-install/services.pm
@@ -276,8 +276,14 @@ sub doit {
#--- the listref of "on" services
sub services {
local $ENV{LANGUAGE} = 'C';
- my @raw_l = run_program::rooted_get_stdout($::prefix, '/sbin/chkconfig', '--list');
- my @l = sort { $a->[0] cmp $b->[0] } map { [ /([^\s:]+)/, /\bon\b/ ] } grep { !/:$/ } @raw_l;
+ my @raw_l = map { chomp; $_ } run_program::rooted_get_stdout($::prefix, '/sbin/chkconfig', '--list');
+ my @l;
+ if ($::isInstall) {
+ @l = sort { $a->[0] cmp $b->[0] } map { [ /([^\s:]+)/, /\bon\b/ ] } grep { !/:$/ } @raw_l;
+ } else {
+ my $runlevel = my $runlevel = (split " ", `/sbin/runlevel`)[1];
+ @l = sort { $a->[0] cmp $b->[0] } map { [ /([^\s:]+)/, /^\t/ ? /\bon\b/ : /\b$runlevel:on\b/ ] } grep { !/:$/ } @raw_l;
+ }
[ map { $_->[0] } @l ], [ map { $_->[0] } grep { $_->[1] } @l ];
}