everywhere: remove configurability of sysv runlevel to target mapping

With this change runlevel 2, 3, 4 are mapped to multi-user.target for
good, and 5 to graphical.target. This was already the previous mapping
but is now no longer reconfigurable, but hard-coded into the core.

This should generally simplify things, but also fix one bug: the
sysv-generator previously generated symlinks to runlevel[2-5].target
units, which possibly weren't picked up if these aliases were otherwise
only referenced by the real names "multi-user.target" and
"graphical.target".

We keep compat aliases "runlevel[2345].target" arround for cases where
this target name is explicitly requested.
This commit is contained in:
Lennart Poettering
2015-02-18 20:20:14 +01:00
parent ac49d36fae
commit d5d8429a12
7 changed files with 34 additions and 51 deletions
+9 -9
View File
@@ -78,15 +78,15 @@ static const char *translate_runlevel(int runlevel, bool *isolate) {
const char *special;
bool isolate;
} table[] = {
{ '0', SPECIAL_POWEROFF_TARGET, false },
{ '1', SPECIAL_RESCUE_TARGET, true },
{ 's', SPECIAL_RESCUE_TARGET, true },
{ 'S', SPECIAL_RESCUE_TARGET, true },
{ '2', SPECIAL_RUNLEVEL2_TARGET, true },
{ '3', SPECIAL_RUNLEVEL3_TARGET, true },
{ '4', SPECIAL_RUNLEVEL4_TARGET, true },
{ '5', SPECIAL_RUNLEVEL5_TARGET, true },
{ '6', SPECIAL_REBOOT_TARGET, false },
{ '0', SPECIAL_POWEROFF_TARGET, false },
{ '1', SPECIAL_RESCUE_TARGET, true },
{ 's', SPECIAL_RESCUE_TARGET, true },
{ 'S', SPECIAL_RESCUE_TARGET, true },
{ '2', SPECIAL_MULTI_USER_TARGET, true },
{ '3', SPECIAL_MULTI_USER_TARGET, true },
{ '4', SPECIAL_MULTI_USER_TARGET, true },
{ '5', SPECIAL_GRAPHICAL_TARGET, true },
{ '6', SPECIAL_REBOOT_TARGET, false },
};
unsigned i;