tech-misc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: where are fsck return values documented?



On Mar 17,  3:14pm, reed%reedmedia.net@localhost ("Jeremy C. Reed") wrote:
-- Subject: Re: where are fsck return values documented?

| > They are documented now in fsck.8
| 
| Thank you for documenting these.
| 
| Now I noticed it reboots every time (per exit code 4 and rc.d/fsck script) 
| after MARKING FILE SYSTEM CLEAN with "Root filesystem was modified, 
| rebooting ..."
| 
| I don't recall it ever doing that before. I know it had option to reboot 
| before but I don't remember ever noticing that happening to me.
| 
| Something else change to cause this?
| 
| I see the new fsck man page says "and updating the mount was 
| unsuccessful". I just don't think I saw any indication of that -- or maybe 
| I don't know what that means.
| 
| Is this necessary? Why?

The code in question is main.c:

        if (hotroot()) {
                struct statvfs stfs_buf;
                /*
                 * We modified the root.  Do a mount update on
                 * it, unless it is read-write, so we can continue.
                 */
                if (statvfs("/", &stfs_buf) == 0) {
                        long flags = stfs_buf.f_flag;
                        struct ufs_args args;

                        if (flags & MNT_RDONLY) {
                                args.fspec = 0;
                                flags |= MNT_UPDATE | MNT_RELOAD;
                                if (mount(MOUNT_FFS, "/", flags,
                                    &args, sizeof args) == 0)
                                        return FSCK_EXIT_OK;
                        }
                }
                if (!preen)
                        pwarn("\n***** REBOOT NOW *****\n");
                sync();
                return FSCK_EXIT_ROOT_CHANGED;
        }

I don't see anything wrong with it. Can you add some debugging to see
what's going on?

christos


Home | Main Index | Thread Index | Old Index