You are not logged in.

#1 2006-05-17 10:05:15

torindan2
Member
Registered: 2004-07-15
Posts: 74

Automatic reboot after filesystem check

Is it possible to make arch automatically reboot after checking partitions and when no errors were found (like in image below) or all errors were automatically corrected (like those with wrong timestamp on deleted files and other small stuff)

archdontautoreboot1hl.th.png

I think debian do so : if nothing is wrong with filesystem it reboots automatically.
Fsck is returning a OR'ed status and you may base your decision on that.

Offline

#2 2006-05-17 10:10:15

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Automatic reboot after filesystem check

Um, in that image, errors were found and it failed.

Offline

#3 2006-05-17 10:13:47

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Automatic reboot after filesystem check

Definitely not. The point of dropping you to single mode is so you can attempt to fix whatever has gone wrong - it should not be regarded merely as an inconvenience.

Apart from that, I think your proposal is the wrong way around:

torindan2 wrote:

if nothing is wrong with filesystem it reboots automatically.

If nothing is wrong, why reboot? :?

Offline

#4 2006-05-17 10:28:57

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Automatic reboot after filesystem check

I just edit my /etc/fstab and put 1 or 2 instead of 0 in the last column of my partitions. Everything works fine, unless something is completely wrong. In which case I wouldn't want the computer to be rebooting endlessly.

Or am I missing the point? Also, what's the advantage of a reboot after a succesful fsck?


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#5 2006-05-17 10:58:03

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Automatic reboot after filesystem check

No, in that image NO ERRORS WERE FOUND. If there are errors fsck outputs each and every of them (even if it corrects them).

So in image i see no errors on fsck (it simply wasn't a clean shutdown) and fsck requested a reboot (you can see "REBOOT LINUX" in the image) but the init script still thinks that the errors were found.

This is part of /etc/rc.sysinit

...
        stat_busy "Checking Filesystems"
        if [ "`cat /proc/cmdline | grep quiet`" ]; then
                /sbin/fsck -A -T -C -a $FORCEFSCK >/dev/null 2>&1
        else
                /sbin/fsck -A -T -C -a $FORCEFSCK
        fi
        if [ $? -gt 1 ]; then
                stat_fail
                echo
                echo "*****************  FILESYSTEM CHECK FAILED  ****************"
...

according to fsck manpage

The exit code returned by fsck is the sum of the following conditions:
            0    - No errors
            1    - File system errors corrected
            2    - System should be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - Fsck canceled by user request
            128  - Shared library error

So simple reboot request (return 2) will trigger

if [ $? -gt 1 ]

and i need to press CTRL+D to reboot the computer this is the only thing i can do because THERE ARE NO ERRORS.

I agree that if something IS WRONG with filesystem human intervention IS NEEDED, but not in this case.
We should change that condition like

if [ $? -gt 3 ]

or something (3 meaning errors were corrected and a reboot is needed)

Offline

#6 2006-05-17 11:02:11

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Automatic reboot after filesystem check

i voted yes but to be honest, i would like this feature to be configurable. on some boxen i'd like to get a single-user mode prompt just to be notified that something went not as planned. it's always good to know if your filesystem was automaticly repaired before you wonder why stuff piles up on lost+found. smile


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#7 2006-05-17 11:12:26

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Automatic reboot after filesystem check

Good point kth5, but still if it asks for a simple reboot (like in my case) without correcting anything, shouldn't we just reboot ?
And anyway the existing code will continue to boot if errors were corrected without reboot request, so you won't be notified sad.

Offline

#8 2006-05-17 11:33:39

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Automatic reboot after filesystem check

torindan2 wrote:

Good point kth5, but still if it asks for a simple reboot (like in my case) without correcting anything, shouldn't we just reboot ?
And anyway the existing code will continue to boot if errors were corrected without reboot request, so you won't be notified sad.

the return code 2 only means that a reboot is necessary but does not automaticly also imply that no modifications or fixes were made, does it? i trust fsck but not in the case it "fixed" something. i fscked too many filesystems with auto-fsck already, so i am overly cautious. i'm running production services here after all. wink


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#9 2006-05-17 11:53:23

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Automatic reboot after filesystem check

kth5 wrote:

the return code 2 only means that a reboot is necessary but does not automaticly also imply that no modifications or fixes were made, does it?

In my interpretation of manpage, if return code is:
- "1" : errors were fixed but no reboot is needed
- "2" : only reboot is needed
- "3" : errors were fixed and reboot is needed
- "4" : errors were not fixed
- "5" : some errors were fixed, some not
- "6" : errors were not fixed, but we need to reboot
- "7" : some errors were fixed, some not and we need to reboot

kth5 wrote:

i fscked too many filesystems with auto-fsck already, so i am overly cautious. i'm running production services here after all. wink

Regarding production servers : I'd like my server to be up as soon as possible (for example when I'm not near it to hit CTRL+D for a simple reboot)

I can't agree more with you that if there are problems we need to check it by hand, but if there are any, why to waste time? reboot and keep going.

Offline

#10 2006-05-17 11:53:56

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Automatic reboot after filesystem check

torindan2 wrote:

I agree that if something IS WRONG with filesystem human intervention IS NEEDED, but not in this case.
We should change that condition like

if [ $? -gt 3 ]

or something (3 meaning errors were corrected and a reboot is needed)

File a bug then.

Offline

#11 2006-05-17 12:23:23

kth5
Member
Registered: 2004-04-29
Posts: 657
Website

Re: Automatic reboot after filesystem check

torindan2 wrote:
kth5 wrote:

i fscked too many filesystems with auto-fsck already, so i am overly cautious. i'm running production services here after all. wink

Regarding production servers : I'd like my server to be up as soon as possible (for example when I'm not near it to hit CTRL+D for a simple reboot)

I can't agree more with you that if there are problems we need to check it by hand, but if there are any, why to waste time? reboot and keep going.

true, that's what i have a second sshd in initrd for though. so even if the filesystem is totally - excuse me - f*cked i can still login and start a fallback lighthttp serving a downtime page. smile


I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell

Offline

#12 2006-05-17 14:51:45

FUBAR
Member
From: Belgium
Registered: 2004-12-08
Posts: 1,029
Website

Re: Automatic reboot after filesystem check

kth5 wrote:

true, that's what i have a second sshd in initrd for though. so even if the filesystem is totally - excuse me - f*cked i can still login and start a fallback lighthttp serving a downtime page. smile

That sounds l33t beyond words. Wikify!!!


A bus station is where a bus stops.
A train station is where a train stops.
On my desk I have a workstation.

Offline

#13 2006-05-17 19:30:33

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Automatic reboot after filesystem check

That's odd, I had the same message today. I agree that if fsck requests a reboot, we should do one automatically.

Offline

#14 2006-05-18 00:01:18

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Automatic reboot after filesystem check

Someone file a bug then!

Offline

#15 2006-05-18 06:41:10

torindan2
Member
Registered: 2004-07-15
Posts: 74

Re: Automatic reboot after filesystem check

It's in FS since yesterday http://bugs.archlinux.org/task/4648

What FlySpray is for if we should post FS entries in the forum each time we fill a bug report? And in this case why to fill bug reports if no one checks for them in FlySpray?

Offline

#16 2006-05-18 07:19:17

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Automatic reboot after filesystem check

torindan2 wrote:

It's in FS since yesterday http://bugs.archlinux.org/task/4648

What FlySpray is for if we should post FS entries in the forum each time we fill a bug report? And in this case why to fill bug reports if no one checks for them in FlySpray?

Um, you dont need to post Flyspray entries on the forums.

And secondly, the devs check for them in flyspray, but do not check for them in the forums, which is why I suggest to post one.

James

Offline

Board footer

Powered by FluxBB