summaryrefslogtreecommitdiff
path: root/src/systemctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-14 19:14:52 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-14 19:14:52 +0200
commitd90e1a301d61c3808ac5c0aa3093b2ec913e406b (patch)
tree482d7493378ea2ba5a35b2ae789fe57194709caf /src/systemctl.c
parent36c32ba297a5296227902cef15730a0e55fec8e7 (diff)
systemctl: skip writing of utmp if we booted using systemd, under the assumption that systemd-update-utmp is used
Diffstat (limited to 'src/systemctl.c')
-rw-r--r--src/systemctl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/systemctl.c b/src/systemctl.c
index 9a85383dba..167c6a5b7f 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4680,9 +4680,12 @@ static int halt_main(DBusConnection *bus) {
if (!arg_dry && !arg_immediate)
return start_with_fallback(bus);
- if (!arg_no_wtmp)
- if ((r = utmp_put_shutdown(0)) < 0)
+ if (!arg_no_wtmp) {
+ if (sd_booted() > 0)
+ log_debug("Not writing utmp record, assuming that systemd-update-utmp is used.");
+ else if ((r = utmp_put_shutdown(0)) < 0)
log_warning("Failed to write utmp record: %s", strerror(-r));
+ }
if (!arg_no_sync)
sync();