FS#16368 - [initscripts] remount all filesystems readonly on shutdown
Attached to Project:
Arch Linux
Opened by André Fettouhi (A.Fettouhi) - Sunday, 27 September 2009, 09:35 GMT
Last edited by Tom Gundersen (tomegun) - Sunday, 27 March 2011, 17:58 GMT
Opened by André Fettouhi (A.Fettouhi) - Sunday, 27 September 2009, 09:35 GMT
Last edited by Tom Gundersen (tomegun) - Sunday, 27 March 2011, 17:58 GMT
|
Details
Edit: Altered title to reflect current issue - Allan
Original report: [glibc] nscd shutdown causes errors on root filesystem Description: I'm running Arch i686 with all the latest updates (27.09.2009) and with KDEmod4. I'm running my network on dhcp and when I shutdown my machine I see that the nscd is also shut down but for some reason this causes my superblock on my root partition to be corrupted. I get a write time in the future error at the next boot and I have to do a scan of my root partition to fix the errors. Why is nscd being run at all and why does it appear in the shutdown process? I recently switched to dhcp, I was running static ip before. Additional info: * package version(s) * config and/or log files etc. glibc-2.10.1-4 Steps to reproduce: PS. The error only appears if I log into my KDE4 session. If I shutdown/reboot directly from KDM then nscd does not appear in the shutdown process list. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Sunday, 27 March 2011, 17:58 GMT
Reason for closing: None
Additional comments about closing: See my last comment. This FS is conflating many issues, mostly bugs in other packages and a feature request.
Sunday, 27 March 2011, 17:58 GMT
Reason for closing: None
Additional comments about closing: See my last comment. This FS is conflating many issues, mostly bugs in other packages and a feature request.
About the superblock problems, I'll run nscd manually and reboot and see what happens. It sound weird though.
Does starting nscd in /etc/rc.conf cause this issue too?
Regards
André
sudo /etc/rc.d/nscd STOP
then shutdown/reboot preceeds as normal and booting up gives no problems at filesystem checking stage.
Regards
André
Regards
André
This bug is keeping me away from Arch Linux :(
However, I have to repeat this again for Mukul: This bug seems to be caused by KDEmod in some obscure fashion which I cannot understand. What I can not and will not do is support KDEmod in any way. So unless you reproduce this bug without KDEmod, don't expect any help here. This bug is actually not keeping you away from Arch, but from KDEmod.
As for fixing the corruption problem itself: I cannot see a way to reproduce it so that we can understand it, so I cannot fix it. Remounting everything read-only might be a workaround (patches welcome, again ...), but doesn't fix the underlying problem.
It appears to be working on my system, but otoh I don't have the problem mentioned here. Everything should probably be remounted ro at shutdown anyway though.
FS#17247has been closed (for no reason ? because i don't see this as a duplicate). mine is randomi DO NOT RUN kde or kdemod. i use gnome. as far as i know, nscd is not running, i have switched from dhcp to static ip recently. the bugs i reported happened with the 2.
i have not seen a nscd shutdown at shutdown.
i have applied the above patch.
i wait and see.
The only difference is that with the patch I made, it's looking for more than just / and tries to remount the rest of the mounted partitions read-only aswell. In most cases, however, everything except / should already have been unmounted at that point in the shutdown script.
I should probably modify the patch and add a lsof command or something to make it easier to see which process is causing problems.
This has been done since 2008.
FS#20292, which I just added (before I found this one). In my case, nscd wasn't running (as far as I'm aware), but bash (executing rc.shutdown) had /var/db/nscd/passwd open. Remounting read-only didn't work for me either.Note: I have a script that makes wicd start openvpn at my office, but this also happens when I'm at home, in which case the vpn isn't started. However, the problems started happening when I changed wicd's configuration, adding scripts to start and stop openvpn.
Of course, that doesn't solve the problem that having nscd running when the shutdown script starts prevents whatever partition /var/db/nscd/passwd is on from being unmounted.
One possible approach is to split rc.shutdown into two parts. The first part stops all daemons and kills all processes, then execs the second part, which finishes everything else off.
I guess remounting read-only, will not necessarily work (if a file is opened for writing), so a robust shutdown algorithm would certainly be welcome. I guess a loop that is alternating between killing processes and attempting to unmount devices would be needed (one process might block a mountpoint from unmounting and at the same time a different mountpoint might block the process from terminating). There are some special cases we have to consider as well. A good place to start looking is in the systemd implementation, as I know it is fairly robust.
If anyone is interested in having a go at this, please email <arch-projects@archlinux.org>, where we can continue the discussion.
About the specific bugs people are experiencing: While a kill/unmount loop would probably fix your problems, and it certainly would be a nice feature, this is not the underlying problem (AFAIU), so I'll close this bug. I suggest opening bugs against the specific programs that are not shutting down properly.