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

Re: too many deamons by default - F7 test 2 live cd



Dave Jones wrote :

> On Mon, Mar 19, 2007 at 02:12:32PM -0400, Jeremy Katz wrote:
> 
>  > > mdmonitor, 
>  > 
>  > If you have RAID, this is important to have.  It could be made to exit a
>  > lot faster, though, by checking for the existence of mdadm.conf before
>  > sourcing /etc/init.d/functions.
> 
> Hmm, what about raid arrays created post install ?
> Checking /proc/mdstat might be safer, a la..
> 
> --- mdmonitor~	2007-03-19 19:38:23.000000000 -0400
> +++ mdmonitor	2007-03-19 19:38:38.000000000 -0400
> @@ -16,6 +16,9 @@ OPTIONS="--monitor --scan -f --pid-file=
>  
>  prog=mdmonitor
>  
> +if [ ! -f /proc/mdstat ]; then exit; fi
> +if [ $(cat /proc/mdstat | wc -l) -eq 2 ]; then exit; fi
> +
>  # Source function library.
>  . /etc/rc.d/init.d/functions

Sometimes it's easy to recognize a C programmer ;-)

# Skip starting if we have no proc entry or if it has 2 lines or less
[ $(cat /proc/mdstat 2>/dev/null | wc -l) -le 2 ] && exit 0

(warning, totally untested!)

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 6 (Zod) - Linux kernel 2.6.19-1.2911.6.5.fc6
Load : 1.07 1.05 0.84


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