1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

main: fall back to rescue target when default target cannot be loaded

This commit is contained in:
Lennart Poettering 2010-04-08 02:00:40 +02:00
parent 82771ba1f9
commit 37d88da701
2 changed files with 7 additions and 1 deletions

7
main.c
View File

@ -307,7 +307,12 @@ int main(int argc, char *argv[]) {
if ((r = manager_load_unit(m, default_unit, &target)) < 0) {
log_error("Failed to load default target: %s", strerror(-r));
goto finish;
log_info("Trying to load rescue target...");
if ((r = manager_load_unit(m, SPECIAL_RESCUE_TARGET, &target)) < 0) {
log_error("Failed to load rescue target: %s", strerror(-r));
goto finish;
}
}
if (action == ACTION_TEST) {

View File

@ -83,6 +83,7 @@ struct Watch {
#define SPECIAL_SYSLOG_TARGET "syslog.target" /* Should pull in syslog.socket or syslog.service */
#define SPECIAL_RTC_SET_TARGET "rtc-set.target" /* LSB's $time */
#define SPECIAL_BASIC_TARGET "basic.target"
#define SPECIAL_RESCUE_TARGET "rescue.target"
/* For SysV compatibility. Usually an alias for a saner target. On
* SysV-free systems this doesn't exist. */