[comp.sys.sun] Preen and SunOS 4.0

rta@ucbvax.berkeley.edu (Rick Ace) (03/01/89)

dpk@morgan.com (Douglas P. Kingston) writes:
> I have noticed that occasionally preen when run under SunOS 4.0 will exit
> in such a way that it causes a reboot and re-check when it is not
> necessary.  I am using a version of preen which uses Sun's new fstab
> reading routines.

I've also seen this behavior.  In the case where fsck detects repairable
errors and repairs them successfully, it *should* exit with the same code
as it uses when the filesystem is perfectly clean to start with.
Unfortunately, SunOS 4.0 fsck does not.

I reported this problem to Sun last November.  Their reply did not
adequately address the problem I had described.  I sent back a second
message explaining that they missed the point, but they never wrote back.
Service # 242409 if you're interested.

Rick Ace
Pixar
3240 Kerner Blvd, San Rafael CA 94901
...!{sun,ucbvax}!pixar!rta

dupuy@cs.columbia.edu (Alexander Dupuy) (03/01/89)

One other problem which I noticed with our Sun-2s running 4.0: if you have
/usr mounted r/w and the pass # is not 1 (we had it as 2, from
suninstall), fsck will run the check as a child.  If there is repairable
damage on /usr (at this point a mounted filesystem) the child will return
4 to indicate that a reboot should be done.  But the parent will return 8
if any of its children return non-zero status, causing rc.boot to fail on
the autoboot.

The fix is for fsck to |-or it's childrens status together, rather than
returning 8 if any are non-zero.

The workaround is to make sure that any filesystems mounted when fsck -p
runs are checked in pass 1.

@alex

berliner@uunet.uu.net (Brian Berliner) (03/01/89)

> Also, can anyone tell me why the /etc/rc.boot distributed by sun tests for
> a return code of 0 or 2 instead of just 0 in the case statement after
> checking the disks?  Fsck is not documented as returning a 2.  What does
> it mean?

"fsck" uses exit status 2 to indicate to rc.boot (and "init") that it has
successfully checked the disks, but not to go directly into multi-user
state.

Typing the QUIT (^\) character while "fsck" is doing its work will cause
"fsck" to exit with a status of 2 instead of zero only if all worked as
expected.  This is basically just a quick out to get you cleanly into
single-user mode, when you forgot to do ">b -s".

If you're running "preen", things may work differently.  You may have to
make "preen" understand this signal handling protocaol and have preen exit
with a 2 instead.

Brian Berliner
Prisma, Inc.
berliner@prisma.com