summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-03-14 16:22:09 +0000
committered <ed@FreeBSD.org>2012-03-14 16:22:09 +0000
commit1204585265bed911e1a2b478cfc9393e528cc941 (patch)
treedea6cb77cabd12edd47299949ca72888b2ddeae7 /etc
parenta6abf8bf85afb844a1c9fe80fb6579823cbf9259 (diff)
downloadFreeBSD-src-1204585265bed911e1a2b478cfc9393e528cc941.zip
FreeBSD-src-1204585265bed911e1a2b478cfc9393e528cc941.tar.gz
Make init(8) slightly more robust when /dev/console is missing.
If the environment doesn't offer a working /dev/console, the existing version of init(8) will simply refuse running rc(8) scripts. This means you'll only have a system running init(8) and nothing else. Change the code to do the following: - Open /dev/console like we used to do, but make it more robust to use O_NONBLOCK to prevent blocking on a carrier. - If this fails, use /dev/null as stdin and /var/log/init.log as stdout and stderr. - If even this fails, use /dev/null as stdin, stdout and stderr. So why us this useful? Well, if you remove the `getpid() == 1' check in main(), you can now use init(8) inside jails to properly execute rc(8). It still requires some polishing, as existing tools assume init(8) has PID 1. Also it is now possible to use use init(8) on `headless' devices that don't even have a serial boot console.
Diffstat (limited to 'etc')
-rw-r--r--etc/newsyslog.conf1
1 files changed, 1 insertions, 0 deletions
diff --git a/etc/newsyslog.conf b/etc/newsyslog.conf
index 67aa117..b750836 100644
--- a/etc/newsyslog.conf
+++ b/etc/newsyslog.conf
@@ -24,6 +24,7 @@
/var/log/cron 600 3 100 * JC
/var/log/daily.log 640 7 * @T00 JN
/var/log/debug.log 600 7 100 * JC
+/var/log/init.log 644 3 100 * J
/var/log/kerberos.log 600 7 100 * J
/var/log/lpd-errs 644 7 100 * JC
/var/log/maillog 640 7 * @T00 JC
OpenPOWER on IntegriCloud