Write a reboot record to /var/log/wtmp

This commit is contained in:
Eelco Dolstra 2013-09-22 16:44:41 +02:00
parent 4be44d011b
commit 50d942960e
2 changed files with 14 additions and 0 deletions

View File

@ -608,5 +608,14 @@ in
users.extraGroups.systemd-journal.gid = config.ids.gids.systemd-journal;
# FIXME: This should no longer be needed with systemd >= 204.
systemd.services."systemd-update-utmp-reboot.service" =
{ description = "Update UTMP about System Reboot";
wantedBy = [ "sysinit.target" ];
unitConfig.DefaultDependencies = false;
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = "${systemd}/lib/systemd/systemd-update-utmp reboot";
};
};
}

View File

@ -47,6 +47,11 @@
subtest "blkio-cgroup", sub {
$machine->succeed("[ -n \"\$(cat /sys/fs/cgroup/blkio/blkio.sectors)\" ]")
};
# Test whether we have a reboot record in wtmp.
subtest "reboot-wtmp", sub {
$machine->succeed("last | grep reboot >&2");
};
'';
}