chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsck: atomically replace base.target by rescue.target/reboot.target when fsck fails
[elogind.git]
/
src
/
fsck.c
diff --git
a/src/fsck.c
b/src/fsck.c
index 702f22c95defa5d37b21833e2f779aad002033f5..b0c3620c8c3d3ddb89a1cd6eabad5ab65680252a 100644
(file)
--- a/
src/fsck.c
+++ b/
src/fsck.c
@@
-38,7
+38,7
@@
static bool arg_force = false;
static void start_target(const char *target, bool isolate) {
DBusMessage *m = NULL, *reply = NULL;
DBusError error;
static void start_target(const char *target, bool isolate) {
DBusMessage *m = NULL, *reply = NULL;
DBusError error;
- const char *mode;
+ const char *mode
, *base_target = "base.target"
;
DBusConnection *bus = NULL;
assert(target);
DBusConnection *bus = NULL;
assert(target);
@@
-57,12
+57,15
@@
static void start_target(const char *target, bool isolate) {
log_debug("Running request %s/start/%s", target, mode);
log_debug("Running request %s/start/%s", target, mode);
- if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnit"))) {
+ if (!(m = dbus_message_new_method_call("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StartUnit
Replace
"))) {
log_error("Could not allocate message.");
goto finish;
}
log_error("Could not allocate message.");
goto finish;
}
+ /* Start these units only if we can replace base.target with it */
+
if (!dbus_message_append_args(m,
if (!dbus_message_append_args(m,
+ DBUS_TYPE_STRING, &base_target,
DBUS_TYPE_STRING, &target,
DBUS_TYPE_STRING, &mode,
DBUS_TYPE_INVALID)) {
DBUS_TYPE_STRING, &target,
DBUS_TYPE_STRING, &mode,
DBUS_TYPE_INVALID)) {
@@
-196,11
+199,7
@@
int main(int argc, char *argv[]) {
}
if (status.si_status & ~1) {
}
if (status.si_status & ~1) {
-
- if (access("/dev/.systemd/late-fsck", F_OK) >= 0) {
- log_error("fsck failed with error code %i.", status.si_status);
- goto finish;
- }
+ log_error("fsck failed with error code %i.", status.si_status);
if (status.si_status & 2)
/* System should be rebooted. */
if (status.si_status & 2)
/* System should be rebooted. */