Backups

Conor P. Cahill cpcahil at virtech.uucp
Wed Feb 28 01:09:26 AEST 1990


In article <1990Feb25.002339.13934 at virtech.uucp>, cpcahil at virtech.uucp (Conor P. Cahill) writes:
> You could modify the /etc/rc2.d scripts so that they verify the 
> state that they are comming from (by parsing the output of who -r).
> The scripts will be run in the initlevel that the system was at.  init
> doesn't change the init level until the state change is complete (in other
> words, until all the scripts have been run).

As Tim Brown pointed out to me in email, this is not totally correct.

Init does in fact change the init level prior to running the scripts. 
However, it also stores the old initlevel in the utmp file so the who -r
output can be used to see what init level you are coming from.  This is 
displayed in the last parameter of the who -r output.

For example:

   .       run-level 3  Feb 26 12:39    3    0    S

The S shows that I came from init level S to init level 3.  I have 
tested going to init level 2 and then to 3 and the last parameter becomes
a 2.  And in going from level 3 to level 2 the line would read something
like:

   .       run-level 2  Feb 26 12:39    2    0    3

So you can always tell where you are coming from and where you are going to.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.i386 mailing list