NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Removing /etc/nologin on shutdown



I'm experimenting with a read-only root file system.

Sometimes I remount / read-write (e.g. to allow adjustments to
configuration files) and the file-system stays writable until the next
reboot.  In particular shutdown(8) can write the /etc/nologin file
which, oddly, survives the reboot to disable non-root logins when the
system comes back up.  I say oddly because the man page for shutdown(8)
states: "The file is removed just before shutdown exits." Normally this
wouldn't matter because mountcritlocal_start removes /etc/nologin
during the boot sequence; but by then / is read-only again and the
removal fails.

As a workaround, I can use reboot(8) to take the system down without
creating /etc/nologin, or perhaps add a mountcritlocal_stop action that
does the removal at shutdown time as I'd expect, but I'd like to
understand the problem first.

So:
- Is the documentation correct?  Should /etc/nologin be removed as the
  system is going down?
- If so, is it /sbin/shutdown's job to remove it, or something in the
  /etc/rc.d scripts?  Where should I look to find out why this isn't
  happening as it should?
- If not (i.e. if removal at the next boot is the expected behaviour),
  what is the best way to submit a documentation patch to have the
  manpage reflect reality?

Thanks,

Ian Leroux
Who is returning to BSD after a long exile in Debian


Home | Main Index | Thread Index | Old Index