chiark / gitweb /
systemctl: skip writing of utmp if we booted using systemd, under the assumption...
authorLennart Poettering <lennart@poettering.net>
Sat, 14 Aug 2010 17:14:52 +0000 (19:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 14 Aug 2010 17:14:52 +0000 (19:14 +0200)
fixme
src/fdset.c
src/systemctl.c

diff --git a/fixme b/fixme
index 26a9787f5c68cd978c6dfdfbf64c9f533e0ba894..e9acede730403dc5dd7e995f732180162c0205e6 100644 (file)
--- a/fixme
+++ b/fixme
@@ -1,7 +1,7 @@
 * dot output for --test showing the 'initial transaction'
 
 * check 'disable'
 * dot output for --test showing the 'initial transaction'
 
 * check 'disable'
-  <Viking-Ice>    "Warning: Unit file changed in disk, 'systemctl --system daemon-reload' recomended
+  <Viking-Ice>    "Warning: Unit file changed in disk, 'systemctl --system daemon-reload' recommended
   <kay>           when does it do that?
   <Viking-Ice>    if you disable the service
 
   <kay>           when does it do that?
   <Viking-Ice>    if you disable the service
 
index b6d5286f8219546429c8e545a97329f9fa1d558b..ad7cd2949c7bb08a3d837b1f4491713e7272a778 100644 (file)
@@ -144,7 +144,6 @@ finish:
                 set_free(MAKE_SET(s));
 
         return r;
                 set_free(MAKE_SET(s));
 
         return r;
-
 }
 
 int fdset_cloexec(FDSet *fds, bool b) {
 }
 
 int fdset_cloexec(FDSet *fds, bool b) {
index 9a85383dbadf84114136c5eb4d383db342e35922..167c6a5b7f2a56e2db407cbb7d1b49c70b9c604a 100644 (file)
@@ -4680,9 +4680,12 @@ static int halt_main(DBusConnection *bus) {
         if (!arg_dry && !arg_immediate)
                 return start_with_fallback(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));
                         log_warning("Failed to write utmp record: %s", strerror(-r));
+        }
 
         if (!arg_no_sync)
                 sync();
 
         if (!arg_no_sync)
                 sync();