Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#3505 - initscripts quirk

Attached to Project: Arch Linux
Opened by Viktor Peters (Mythoz) - Saturday, 19 November 2005, 10:22 GMT
Last edited by Tobias Powalowski (tpowa) - Saturday, 19 November 2005, 16:07 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity Very Low
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

A short while ago support for RAID arrays was added to rc.sysinit:

if [ -f /etc/mdadm.conf -a "`grep ^ARRAY /etc/mdadm.conf 2>/dev/null`" ]; then
[...]
fi

But the first test is completely pointless since the shell test AND ("[ ... -a ... ]") is not an conditional AND like in C/C++. The grep is excuted anyway regardless of the result of the first test. The redirection of all messages to /dev/null is an ugly way to hide this missbehaviour. A simple correction is:

if [ -f /etc/mdadm.conf ] && grep -q ^ARRAY /etc/mdadm.conf; then
[...]
fi

Or if performance does not matter:

if grep -q -s ^ARRAY /etc/mdadm.conf; then
[...]
fi


This task depends upon

Closed by  Judd Vinet (judd)
Saturday, 19 November 2005, 19:07 GMT
Reason for closing:  Won't fix
Comment by Judd Vinet (judd) - Saturday, 19 November 2005, 19:06 GMT
I think you're splitting hairs here. Unless rc.sysinit is *broken*, I wouldn't be calling this a bug.

rc.sysinit is not something that needs to be aerodynamic or O(1). It's bash.

Loading...