From 33ce1592c101aac4c0de42bfe864eb730ac00804 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Wed, 20 Jul 2016 19:57:39 +0200 Subject: [PATCH] bootmisc: Create /var/log/wtmp and lastlog too Set correct permission bits, the utmp group must have write permission. Signed-off-by: Joachim Nilsson --- plugins/bootmisc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/bootmisc.c b/plugins/bootmisc.c index 923f36a6..da17b52f 100644 --- a/plugins/bootmisc.c +++ b/plugins/bootmisc.c @@ -65,7 +65,14 @@ static void setup(void *UNUSED(arg)) _d("Setting up necessary UTMP files ..."); touch("/var/run/utmp"); + chmod("/var/run/utmp", 0664); chown("/var/run/utmp", 0, getgroup("utmp")); + touch("/var/log/wtmp"); + chmod("/var/log/wtmp", 0664); + chown("/var/log/wtmp", 0, getgroup("utmp")); + touch("/var/log/lastlog"); + chmod("/var/log/lastlog", 0664); + chown("/var/log/lastlog", 0, getgroup("utmp")); _d("Setting initial runlevel 'S', bootstrap ..."); runlevel_set(0, 0); /* Bootstrap 'S' */