From: Lennart Poettering Date: Mon, 14 Feb 2011 23:30:51 +0000 (+0100) Subject: fsck: do not fail boot if fsck returns with an error code that hasn't 2 or 6 set X-Git-Tag: v18~17 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4c24ff75a57efc95b34ece5a7805c3b156208ef;p=systemd fsck: do not fail boot if fsck returns with an error code that hasn't 2 or 6 set --- diff --git a/TODO b/TODO index b2b96826..8f9f76e0 100644 --- a/TODO +++ b/TODO @@ -5,9 +5,7 @@ Bugs: * when plymouth is disabled the console password entry stuff seems to be borked https://bugzilla.redhat.com/show_bug.cgi?id=655538 -* fsck.btrfs non-existance should not cause mounting to fail - -* single user service needs to be masked? +* systemctl default is started when we type "reboot" at rescue mode prompt Features: diff --git a/src/fsck.c b/src/fsck.c index fdcf6b43..7855f3ac 100644 --- a/src/fsck.c +++ b/src/fsck.c @@ -57,7 +57,7 @@ static void start_target(const char *target, bool isolate) { else mode = "replace"; - log_debug("Running request %s/start/%s", target, mode); + log_info("Running request %s/start/%s", target, mode); if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnitReplace"))) { log_error("Could not allocate message."); @@ -247,12 +247,16 @@ int main(int argc, char *argv[]) { else log_error("fsck failed due to unknown reason."); - if (status.si_code == CLD_EXITED && status.si_status & 2) + if (status.si_code == CLD_EXITED && (status.si_status & 2) && root_directory) /* System should be rebooted. */ start_target(SPECIAL_REBOOT_TARGET, false); - else + else if (status.si_code == CLD_EXITED && (status.si_status & 6)) /* Some other problem */ start_target(SPECIAL_EMERGENCY_TARGET, true); + else { + r = EXIT_SUCCESS; + log_warning("Ignoring error."); + } } else r = EXIT_SUCCESS;