You are not logged in.
Pages: 1
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)
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
Um, in that image, errors were found and it failed.
Offline
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:
if nothing is wrong with filesystem it reboots automatically.
If nothing is wrong, why reboot? :?
Offline
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
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
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.
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
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 .
Offline
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.
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.
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
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
i fscked too many filesystems with auto-fsck already, so i am overly cautious. i'm running production services here after all.
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
I agree that if something IS WRONG with filesystem human intervention IS NEEDED, but not in this case.
We should change that condition likeif [ $? -gt 3 ]
or something (3 meaning errors were corrected and a reboot is needed)
File a bug then.
Offline
kth5 wrote:i fscked too many filesystems with auto-fsck already, so i am overly cautious. i'm running production services here after all.
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.
I recognize that while theory and practice are, in theory, the same, they are, in practice, different. -Mark Mitchell
Offline
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.
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
That's odd, I had the same message today. I agree that if fsck requests a reboot, we should do one automatically.
Offline
Someone file a bug then!
Offline
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
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
Pages: 1