Thanks for the patch!

This one time, at band camp, Ralf Dragon said:
> > /usr/share/doc/hdparm/README.Debian mentions why hdparm does not run
> > it's init script if the array is rebuilding.  I do not use software raid
> > myself, so I am relying on reports from others.
> 
> I grepped this file for "raid", sorry that I didn't read it completely.

No sweat - I have tried to clean it up and reorganize it a little, to
make it easier to find stuff in it.

> # default settings for hdparm
> # this file is sourced from /etc/init.d/hdparm
> 
> # uncomment this if you really want to start hdparm even if md is not ok
> # <perhaps some explanations why this is not enabled by default>
> #DIRTYRAID=OK

I don't think this is something that you want to set on a permanent
basis - hdparm should only be run on a dirty array if you have thought
about it ahead of time, and decided to go ahead.

> # <other variables>
> DISC=
> DEFAULT=
> OPTIONS=
> DEF_QUIET=
> OPT_QUIET=

These aren't really meant to be set directly - they are set to null
initially just to make sure that they aren't accidentally imported from
the environment.

> ! if ! [[ "$raidstat" == 'OK' || "$DIRTYRAID" == 'OK' ]]; then
>     report_error "RAID status not OK.  Exiting."
>     exit 0
>   fi

The '==' construct (as opposed to just '=' ) is not POSIX, and a number
of shells choke on it.  Just pointing it out - the script in general is
not completely POSIX compliant, although I am slowly getting it closer.

So:

The only good argument to putting the bypass option directly into the
init script via a defaults/ file that I can see would be if hdparm could
then be run _before_ the array starts to rebuild.  Unfortunately, array
rebuilding starts even before /etc/rcS/07, so we buy nothing and gain
the potential to really screw things up:(.

I think the best solution here is to evalutate an environment variable
(I have arbitrarily chosen FORCE_RUN just now) so the admin can bypass
the simple-minded safety checks (and in this implementation, it skips
even the evaluation of the kernel command line).  This means running
the init script by hand after boot up, but I think forcing this is OK,
as it's not something that (IMHO, at least) should be encouraged to
happen non-interactively.

I have also documented this in README.Debian, as well as the safety
checks themselves.

Does this seem sufficient to allow you to do what you need to do?
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Attachment: pgpKGCVmWzsiA.pgp
Description: PGP signature

Reply via email to