add support for writing reboot and shutdown records to wtmp

This commit is contained in:
William Hubbs
2017-06-02 14:07:40 -05:00
parent 1564e155b7
commit 7689106aa1
5 changed files with 121 additions and 24 deletions

View File

@@ -32,6 +32,7 @@
#include "helpers.h"
#include "rc.h"
#include "rc-wtmp.h"
#include "version.h"
static const char *rc_default_runlevel = "default";
@@ -82,6 +83,7 @@ static void init(const char *default_runlevel)
}
pid = do_openrc(runlevel);
waitpid(pid, NULL, 0);
log_wtmp("reboot", "~~", 0, RUN_LVL, "~~");
}
static void handle_reexec(char *my_name)