Run levels 5 & 6 (Re: AT&T 386 UNIX reboot)

Bill Kennedy bill at ssbn.WLK.COM
Mon Nov 28 09:44:29 AEST 1988


In article <5284 at cbmvax.UUCP>, ditto at cbmvax.UUCP (Michael "Ford" Ditto) writes:
> In article <254 at ssbn.WLK.COM> bill at ssbn.WLK.COM (Bill Kennedy) writes:
> >An article I posted earlier asks if anyone knows how to make run levels
> >5 or 6 work with AT&T 386 UNIX.

First thanks to Ford for suggesting someplace else to look.

> Here's what I did:  Append the following to /etc/rc0:
> 
> 	set `who -r`
> 	[ $7 = 5 ] && /etc/uadmin 2 0
> 	[ $7 = 6 ] && /etc/uadmin 2 1

I took some license and made that
set `who -r`
if [ $7 = 6 ]
then
	/etc/uadmin 2 1
else
	/etc/uadmin 2 0
fi

The original last line in /etc/rc0 was

/etc/uadmin 2 0

Which shuts down and halts.  It turns out that if you init 6 then /etc/rc0
never gets executed :-(

> Now, "shutdown -i5" will halt the machine and "shutdown -i6" will reboot it;
> in both cases all filesystems (including root) are unmounted and marked as
> "clean" so that they won't be automatically fsck'd when the system comes up.

But only if you get to /etc/rc0.  It appears that init is the culprit.

> This was actually on an Amiga, not a 386, but I suspect that it would work
> if the command codes to uadmin are the same.

I suspect they are, /usr/include/sys/uadmin.h says that the three commands
A_SHUTDOWN=2, A_REBOOT=1, A_REMOUNT=4 and the functions that go with them
AD_HALT=0, AD_BOOT=1, AD_IBOOT=2 with the difference between the first and
second boot being whether or not you use /unix or prompt for the system name.

> 					-=] Ford [=-

So I'm farther along but still not there.  It appears that I should leave
a clue file to execute.  In other words always init 0 in order to execute
/etc/rc0 and then look at the clue file to see whether I should reboot or
not.  That seems a bit bizarre but I never claimed to be elegant.  Does
anyone have any better suggestions?
-- 
Bill Kennedy  usenet      {killer,att,rutgers,sun!daver,uunet!bigtex}!ssbn!bill
              internet    bill at ssbn.WLK.COM



More information about the Comp.sys.att mailing list