]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r232977 and r233945:
authored <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Feb 2013 17:57:17 +0000 (17:57 +0000)
committered <ed@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 19 Feb 2013 17:57:17 +0000 (17:57 +0000)
commitee5bbbb494ac35b6de568912717b0f5419ce92ae
tree496abee923461a2e4d008d86e55d04b347baba33
parent9fe9e600400014c6585d76138fe7060623a7294d
MFC r232977 and r233945:

  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.

git-svn-id: svn://svn.freebsd.org/base/stable/9@247004 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sbin/init/init.8
sbin/init/init.c
sbin/init/pathnames.h