diff --git a/conf.d/bootmisc b/conf.d/bootmisc index dd5b08e01..dda96dfc1 100644 --- a/conf.d/bootmisc +++ b/conf.d/bootmisc @@ -13,3 +13,6 @@ log_dmesg="YES" # This may be useful if you need to compare the current boot to the # previous one. #previous_dmesg=no + +# Whether utmp/wtmp files should be created during boot +#disable_utmp_creation="no" diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index 33f676a6f..841027589 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -190,14 +190,16 @@ start() fi if checkpath -W /var/run; then - ebegin "Creating user login records" - local xtra= - [ "$RC_UNAME" = NetBSD ] && xtra=x - for x in "" $xtra; do - mkutmp /var/run/utmp$x - done - [ -e /var/log/wtmp ] || mkutmp /var/log/wtmp - eend 0 + if ! yesno ${disable_utmp_creation:-no}; then + ebegin "Creating user login records" + local xtra= + [ "$RC_UNAME" = NetBSD ] && xtra=x + for x in "" $xtra; do + mkutmp /var/run/utmp$x + done + [ -e /var/log/wtmp ] || mkutmp /var/log/wtmp + eend 0 + fi mountinfo -q -f tmpfs /var/run || cleanup_var_run_dir fi @@ -243,7 +245,7 @@ stop() { # Write a halt record if we're shutting down if [ "$RC_RUNLEVEL" = shutdown ]; then - if [ "$RC_UNAME" = Linux ]; then + if [ "$RC_UNAME" = Linux ] && ! yesno ${disable_utmp_creation:-no}; then if [ -x /sbin/halt ]; then halt -w else