[comp.unix.i386] Backups

tim@comcon.UUCP (Tim Brown) (02/23/90)

Can someone help with this problem?  I am running ISC202 and have a
wangtek tape.  I would like to be able to bring the system to a quiesent
state (no logins, print spooler etc) and perform the backup and then back
to normal.  I have played with using init 4 and then init 2 but the
switch back to init 2 does more than I need.  Any ideas?

Thanks

Tim Brown                           |
Computer Connection                 |
(attmail or uunet)!comcon!tim       |

cpcahil@virtech.uucp (Conor P. Cahill) (02/25/90)

In article <331@comcon.UUCP> tim@comcon.UUCP (Tim Brown) writes:
>Can someone help with this problem?  I am running ISC202 and have a
>wangtek tape.  I would like to be able to bring the system to a quiesent
>state (no logins, print spooler etc) and perform the backup and then back
>to normal.  I have played with using init 4 and then init 2 but the
>switch back to init 2 does more than I need.  Any ideas?

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).

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

cpcahil@virtech.uucp (Conor P. Cahill) (02/27/90)

In article <1990Feb25.002339.13934@virtech.uucp>, cpcahil@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     |
+-----------------------------------------------------------------------+