1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00
freebsd/sbin
Ed Schouten 4c2c7b2c94 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.
2012-03-14 16:22:09 +00:00
..
adjkerntz Fix a variety of grammar and style nits 2012-03-09 01:32:05 +00:00
atacontrol
atm In sbin/atm/atmconfig/diag.c, fix a few warnings about format strings 2011-12-17 00:26:45 +00:00
badsect Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
bsdlabel Globally replace u_int*_t from (non-contributed) man pages. 2012-02-12 18:29:56 +00:00
camcontrol Fix build when RELEASE_CRUNCH is defined. 2012-01-29 09:12:34 +00:00
ccdconfig Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
clri
comcontrol
conscontrol
ddb
devd Fix build. 2012-01-06 15:01:05 +00:00
devfs Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
dhclient Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
dmesg Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
dump Replace index() and rindex() calls with strchr() and strrchr(). 2012-01-03 18:51:58 +00:00
dumpfs Add missing -l flag to usage(). 2011-12-26 16:47:45 +00:00
dumpon
fdisk Fix multi-line comment formatting. 2011-11-07 07:50:35 +00:00
fdisk_pc98 Add reference to gpart(8). 2011-11-06 20:39:35 +00:00
ffsinfo Remove trailing whitespace. 2011-11-09 21:01:50 +00:00
fsck Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
fsck_ffs Be more helpful about alternate superblocks. 2012-02-10 12:01:19 +00:00
fsck_msdosfs Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
fsdb Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile, 2012-03-09 21:02:39 +00:00
fsirand Fix warning when compiling with gcc46: 2012-01-10 02:59:43 +00:00
gbde Use NO_WCAST_ALIGN for sbin/gbde, this is more appropriate to fix the 2011-12-17 00:14:40 +00:00
geom Fix a variety of grammar issues and style nits. 2012-03-04 16:37:44 +00:00
ggate
growfs After r232548, clang complains about the apparent '=-' operator (a 2012-03-12 11:15:44 +00:00
gvinum Fix warning when compiling with gcc46: 2012-01-10 02:59:26 +00:00
hastctl For functions that return -1 on failure check exactly for -1 and not for 2012-01-10 22:39:07 +00:00
hastd Nice range comparison. 2012-02-11 16:41:52 +00:00
ifconfig Fix typo and bump the document date which I also forgot. 2012-03-07 06:25:17 +00:00
init Make init(8) slightly more robust when /dev/console is missing. 2012-03-14 16:22:09 +00:00
ipf Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too 2011-12-17 00:54:09 +00:00
ipfw - Add ipfw eXtended tables permitting radix to be used for any kind of keys. 2012-03-12 14:07:57 +00:00
iscontrol Whitespace cleanup: 2012-02-25 15:21:43 +00:00
kldconfig
kldload
kldstat
kldunload
ldconfig
mca
md5 - new sentence should start on new line. 2011-11-13 17:07:43 +00:00
mdconfig Add missing "static". 2012-03-14 10:10:15 +00:00
mdmfs Spelling fixes for sbin/ 2012-01-07 16:09:33 +00:00
mknod
mksnap_ffs
mount Don't print the nmount(2) provided error message if it is empty. 2012-01-20 12:59:12 +00:00
mount_cd9660 Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_ext2fs Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_hpfs
mount_msdosfs Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_nfs Add a timeout on positive name cache entries in the NFS client. That is, 2012-01-25 20:05:58 +00:00
mount_ntfs Remove trailing whitespace. 2012-01-28 13:41:34 +00:00
mount_nullfs Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_reiserfs Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_std Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_udf Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
mount_unionfs Change checkpath() to not exit on error. This is a prerequisite for 2012-01-16 19:34:21 +00:00
natd Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
newfs Fix warning when compiling with gcc46: 2012-01-10 02:59:09 +00:00
newfs_msdos Globally replace u_int*_t from (non-contributed) man pages. 2012-02-12 18:29:56 +00:00
nfsiod
nos-tun
pfctl
pflogd
ping
ping6 Fix warning when compiling with gcc46: 2012-01-10 02:59:01 +00:00
quotacheck
rcorder Add more static keywords to rcorder(8). 2011-12-11 20:48:40 +00:00
reboot Add BSD copyright notice. 2012-02-07 14:06:30 +00:00
recoverdisk Fix mdoc date from previous commit. 2012-01-06 11:42:03 +00:00
resolvconf
restore
route Fix a possible infinite loop in "route flush" on 64-bit archs. 2012-02-04 17:53:22 +00:00
routed Fix a style bug 2012-01-13 06:56:59 +00:00
rtsol
savecore
sconfig
setkey
shutdown Replace index() and rindex() calls with strchr() and strrchr(). 2012-01-03 18:51:58 +00:00
spppcontrol
sunlabel
swapon Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
sysctl If the -d flag is specified, ignore any new values specified and only 2011-12-01 15:01:23 +00:00
tunefs Fix warning when compiling with gcc46: 2012-01-10 02:58:52 +00:00
umount Add missing static keywords for global variables to tools in sbin/. 2011-11-04 13:36:02 +00:00
Makefile
Makefile.amd64
Makefile.arm
Makefile.i386
Makefile.ia64
Makefile.inc
Makefile.mips
Makefile.pc98
Makefile.sparc64