NetBSD-Bugs archive

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

misc/37802: Report daily dirty RAIDframe parity, order /etc/rc.d/raidframeparity before /etc/rc.d/securelevel

>Number:         37802
>Category:       misc
>Synopsis:       Report daily dirty RAIDframe parity, order 
>/etc/rc.d/raidframeparity before /etc/rc.d/securelevel
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 18 20:10:00 +0000 2008
>Originator:     rudolf
>Release:        netbsd-4
Please see the following email and corresponding discussion:

The /etc/rc.d/raidframeparity script should be ordered before 
/etc/rc.d/securelevel - otherwise it is possible to get EPERM if the 
securelevel is raised in /etc/rc.conf and the parity might then be left 

I also suggest to test if the parity is clean from /etc/daily along 
with failed raidframe components.
Set securelevel to 2 on a computer with raidframe mirrored disks and go through 
the power outage. You'll find out you'll have to go to single user to repair it 
(problem with wrong order of rc.d scripts) and if you just check the daily 
scripts, you'll think the raid is ok (problem with the daily script).
--- etc/daily.orig      2007-05-15 22:43:07.000000000 +0200
+++ etc/daily   2007-05-15 22:55:09.000000000 +0200
@@ -77,6 +77,7 @@
 if checkyesno find_core; then
        # Turn "foo !bar bax" into "-fstype foo -o ! -fstype bar -o -fstype bax"
@@ -176,13 +177,18 @@
                        echo "$dev:" >> $TMP2
                        cat $TMP >> $TMP2
+               `raidctl -p $dev > /dev/null` || echo $dev >> $TMP3
                rm -f $TMP
        if [ -s $TMP2 ]; then
                echo "failed RAIDframe component(s):"
                        cat $TMP2
-       rm -f $TMP2
+       if [ -s $TMP3 ]; then
+               echo "RAIDframe device(s) with dirty parity:"
+                       cat $TMP3
+       fi
+       rm -f $TMP2 $TMP3
 if checkyesno check_mailq; then

Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

--- etc/rc.d/raidframeparity.orig       2007-05-15 20:11:31.000000000 +0200
+++ etc/rc.d/raidframeparity    2007-05-15 20:13:01.000000000 +0200
@@ -4,6 +4,7 @@
 # REQUIRE: quota
+# BEFORE:  securelevel
 $_rc_subr_loaded . /etc/rc.subr

Home | Main Index | Thread Index | Old Index