UTMP: Set BOOT_TIME record and add shutdown

This patch adds support for initializing /var/run/utmp with the initial
reboot as well as a shutdown record in the UTMP db.

Also, the run level change now properly records ~ and ~~ as line and id,
respectively, and the kernel release and time of each UTMP record is now
set properly.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-08-08 19:06:35 +02:00
1 parent 27899feea0
commit addc21bdf6
4 files changed
+43 -5

No files matched your search

+5 -1
View File
@@ -42,8 +42,9 @@
#include "plugin.h"
#include "service.h"
#include "sig.h"
#include "tty.h"
#include "sm.h"
#include "tty.h"
#include "utmp-api.h"
int debug = 0;
int quiet = QUIET_MODE; /* Delayed disable of silent mode. */
@@ -269,6 +270,9 @@ int main(int argc, char* argv[])
mount("tmpfs", "/run", "tmpfs", MS_NODEV, "mode=0755,size=10%");
umask(022);
/* Set BOOT_TIME UTMP entry */
utmp_set_boot();
/*
* Parse kernel parameters
*/