hacking init

William L. Sebok wls at astrovax.UUCP
Sun Apr 1 17:32:23 AEST 1984


Playing with init is one of the scarier things one might do to unix.  I keep
a backup root on another disk just in case something horrible happens to the
normal root, such as the death of init.  Another thing I try to do is to make
a "disaster recovery" tape, which is a distribution format tape but containing
the current system (or at the very least containing disk drivers that recognize
the present locations of the disk partition boundaries).

  There are in fact some changes I would like to see in init.  There should be
a better way of communicating with init than the sledgehammer approach of
editing /etc/ttys and sending it a hangup signal.  For one thing one gets no
notification when init has reacted to the hangup signal and enabled/disabled
logins on the changed line.  This can either happen very quickly or can take
quite a while if init has to be swapped in on a loaded system.

  I play this game to use the same lines for dialing in and dialing out.
<FLAME ON> I think that there is no excuse that the distributed Unices (either
USG or Berkeley) do not already provide this. <FLAME OFF>.  Because of the above
problem it is hard to impossible to turn on/off logins cleanly.  The best one
can do is to put in long sleeps and hope they are enough.

  On BSD 4.2 it would be nice for init to have some socket to be used to
communicate with the outside world.  That, I believe, would be the correct,
non-hacky way to handle it.  Otherwise, a possible hacky change one could make
to init would be to let it understand + and - in the positions of /etc/ttys
normally occupied by 1 (login enabled) or 0 (login disabled).  If one placed
a + on the /etc/ttys entry for a terminal and sent a hangup to init, it would
enable login on that terminal and replace the + in /etc/ttys with 1 when it
finished.  Likewise a - in /etc/ttys would cause init to disable the line and
replace it with a 0 when finished.
-- 
Bill Sebok			Princeton University, Astrophysics
{allegra,akgua,burl,cbosgd,decvax,ihnp4,kpno,princeton,vax135}!astrovax!wls



More information about the Comp.unix mailing list