/etc/rc.sysinit suggested improvement

Miloslav Trmac mitr at volny.cz
Sun Aug 27 23:23:42 UTC 2006


Hello,
ray hammond napsal(a):
> For example, line 20 mounts the /proc directory.  Prior to this, no checks
> are performed to ensure:
> 	a) mount exists 
> 	b) mount is executable
> 	c) mount success
First, such checks will always be incomplete; we can't reasonably expect
to guard against every possible condition (should we e.g. checksum mount
to verify the binary is not corrupted?  In that case we should checksum
the checksum utility as well ;-) ).  Some things, e.g. fsck detecting
filesystem inconsistencies, can be reasonably expected; but if you try
to enumerate all things that could possibly go wrong, I guess 99% of
them happen extremely rarely.

Second, if /bin/mount doesn't exist, it can't be fixed automatically,
and you need an Unix power user to manually install it;  such an user
can probably quite easily notice /bin/mount is missing.

Most importantly, each such check may be buggy, or become buggy later
due to bit rot.  rc.sysinit is run in an incomplete environment (with no
remote access possible yet), so it should be as reliable as possible.
Adding code that is very rarely executed or tested would probably make
rc.sysinit less, not more, reliable.
	Mirek




More information about the devel mailing list