diff options
Diffstat (limited to 'lib/boot-time-aux.h')
-rw-r--r-- | lib/boot-time-aux.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/boot-time-aux.h b/lib/boot-time-aux.h index a7babf6dc64..8b966fe691f 100644 --- a/lib/boot-time-aux.h +++ b/lib/boot-time-aux.h @@ -86,15 +86,21 @@ get_linux_uptime (struct timespec *p_uptime) static int get_linux_boot_time_fallback (struct timespec *p_boot_time) { - /* On Alpine Linux, UTMP_FILE is not filled. It is always empty. - So, get the time stamp of a file that gets touched only during the - boot process. */ + /* On Devuan with the 'runit' init system and on Artix with the 's6' init + system, UTMP_FILE contains USER_PROCESS and other entries, but no + BOOT_TIME entry. + On Alpine Linux, UTMP_FILE is not filled. It is always empty. + So, in both cases, get the time stamp of a file that gets touched only + during the boot process. */ const char * const boot_touched_files[] = { "/var/lib/systemd/random-seed", /* seen on distros with systemd */ - "/var/run/utmp", /* seen on distros with OpenRC */ - "/var/lib/random-seed" /* seen on older distros */ + "/var/lib/urandom/random-seed", /* seen on Devuan with runit */ + "/var/lib/random-seed", /* seen on Artix with s6 */ + /* This must come last, since on several distros /var/run/utmp is + modified when a user logs in, i.e. long after boot. */ + "/var/run/utmp" /* seen on Alpine Linux with OpenRC */ }; for (idx_t i = 0; i < SIZEOF (boot_touched_files); i++) { |