Also detect actual current runlevel

http://www.virtualmin.com/node/17333
This commit is contained in:
Jamie Cameron
2011-02-27 22:16:02 -08:00
parent 98f4e91399
commit 0ab1aceb1b

View File

@@ -369,6 +369,13 @@ if ($config{"inittab_rl_$rv[0]"}) {
@rv = split(/,/, $config{"inittab_rl_$rv[0]"});
}
push(@rv, $config{'inittab_extra'});
# Add current runlevel. This is needed on EC2, as the boot runlevel can be
# 4 even if inittab says 3!
local $out = &backquote_command("who -r 2>/dev/null");
if (!$? && $out =~ /run-level\s+(\d+)/) {
push(@rv, $1);
}
return &unique(@rv);
}