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

[Fwd: raidtools2 "bug" + fix]



Hi,

I'm maintainer of raidtools2 and i'm having some trouble with the
cron.daily script. This script checks if there are failed disks or if
there are spare disks in use.

Well the following guy is having trouble with it and i can't get it why
it failed on his place. I've here a suitable setup and using also
raidtools2 and all is going ok. It's about this expression:

RAIDDEV=$(awk '/^[:blank:]*raiddev/ {print " " $2}' /etc/raidtab)

This expression should get all the second arguments of lines beginning
with raiddev. Can someone point me what's here failing ?

Matthijs Mohlmann

-----Forwarded Message-----
From: Gabor FUNK <email>
To: matthijs@cacholong.nl
Subject: raidtools2 "bug" + fix
Date: Thu, 30 Sep 2004 17:14:39 +0200

Running Debian testing I have daily mail from raidtools2
with the following contents:

/etc/cron.daily/raidtools2:
lsraid: Unable to query md device "sample": No such file or directory
lsraid: Unable to query md device "raiddev": No such file or directory
lsraid: Unable to query md device "raiddev": No such file or directory

This is because I have the following lines in the raidtab file:

    #    sample raiddev configuration file
...
# raiddev /dev/md2 ...
# raiddev /dev/md2 ...

If you change the regexp to match only
beginning line + (space/tab) * + "raiddev" string
then this could be eliminated.
I tested it with the
RAIDDEV = .... | grep "^[[:space:]]*raiddev" | awk ....
line, and it is ok, it skips anything like
    # raiddev ...
    # my fantastic 1st raiddev config ...
    blablabla raiddev
etc.

For me, \s and/or \t didn't work in the regex, don't
know why...


G.



Reply to: