Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#2044 - /etc/init.d/mdadm is set to STOP=98 before /etc/init.d/umount at STOP=99 #6920

Open
openwrt-bot opened this issue Jan 3, 2019 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

josephtingiris:

Supply the following if possible:

  • Device problem occurs on

specifically tested & confirmed on x86-64 and ipq806x

  • Software versions of OpenWrt/LEDE release, packages, etc.

18.06.1 and snapshot

  • Steps to reproduce

opkg install mdadm

@openwrt-bot
Copy link
Author

josephtingiris:

If mdadm is stopped with mounted filesystems then corruption could occur. In fact, it wont allow it unless it's --force'ed and that's not done with /etc/init.d/mdadm as-is (nor should it be). i.e.

mdadm: Cannot get exclusive access to /dev/md0:Perhaps a running process, mounted filesystem or active volume group?

The proper order would be to umount first, then stop the meta device(s).

I've been trying to work around the installed packaged code, to avoid breaking the upgrade paths. However, this is one that I think should be fixed upstream. Changing /etc/init.d/mdadm to STOP=99 would not suffice because m is before u in the sort order. Many other permutations, e.g. K100mdadm or K999mdadm sort incorrectly too.

What would work is to reverse the order, e.g. mdadm is STOP=98 and umount is STOP=97. Leave 99 open for future use.

@openwrt-bot
Copy link
Author

josephtingiris:

FWIW; this works & wont break the upgrade path ..

**# cp /etc/init.d/umount /etc/init.d/umount97
**

#!/bin/sh /etc/rc.common

Copyright (C) 2006 OpenWrt.org; hack

STOP=97
stop() {
sync
/bin/umount -a -d -r
}

# service umount97 enable

@openwrt-bot
Copy link
Author

josephtingiris:

lvm2 is a community package. This issue has been resubmitted, here:

openwrt/packages#7954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant