help-cfengine
[Top][All Lists]
Advanced

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

Re: Maintaining RC symlinks


From: Chip Seraphine
Subject: Re: Maintaining RC symlinks
Date: Mon, 14 Jun 2004 07:01:32 -0500
User-agent: KMail/1.5.4

On Thursday 10 June 2004 23:44, you wrote:
> On Wed, 9 Jun 2004, Chip Seraphine wrote:
> > groups:
> >        has_mysql_runlinks=  ( IsLink(/etc/rc3.d/S90mysql)
> >                               IsLink(/etc/rc5.d/S90mysql) )
> 
> I don't know how much you've tested this, but it is highly unlikely that 
> this is doing what you think it is.

Actually, I assumed that this was an OR situation, just like any regular old use
of group=(class1 class2).

> Cfengine parses the above line as two separate values for 
> 'has_mysql_runlinks', which means that the last value ends up being the 
> real value.  It doesn't matter what the results of any other IsLink() 
> calls are.  I just verified this.
> 
> If you want the test to work as (I think you) expect, you need to AND 
> those IsLink() calls:

I want the class to be set if either link exists; if cfengine is ignoring the 
IsLink
in favor of the second, than that is either a bug in the docs or the code...  I 
guess
I hadn't noticed it because it is a rather contrived situation for one symlink 
to exist
but not the other.

> 
> groups:
>       has_mysql_runlinks = (
>               IsLink(/etc/rc3.d/S90mysql).IsLink(/etc/rc5.d/S90mysql)
>       )
> 
> > links:
> >     mysqlserver::
> >             /etc/rc3.d/S90mysql     -> ../init.d/mysql
> >             /etc/rc5.d/S90mysql     -> ../init.d/mysql
> >
> > shellcomamnds:
> >     !mysqlserver.has_mysql_runlinks::
> >             "/bin/rm -f /etc/rc*.d/S90mysql"
> >
> >
> > This method is rather clunky (editing 3 seperate sections) and inefficient
> > (every host stats for two symlinks every run).
> 
> Ayup, although it's the maintenance clunkliness I'd be worried about, not 
> the stat'ing.  I don't expect there's much you can do about that.

Methinks you are correct.

> 
> > Here is what (unless somebody has a better, more cfenginey way) I intend to
> > do:
> >
> > groups:
> >     mysqlserver=            ( dbhost1 dbhost2 )
> >     service_mysqlserver=    ( mysqlserver )
> >
> > shellcommands:
> >     "/var/cfengine/bin/cfservice '$(allclasses)'"
[snip]
> 
> Hmm.  I keep recommending this and everyone keeps ignoring me, so feel 
> free to do so, but....
> 
> I _would_ write an external script, but it would be very simple.  Maintain 
> a mapping between classes (e.g., mysqlserver) and appropriate runlevel 
> options:

What you posted was pretty close to my cfservice thingie....

-- 

Chip Seraphine
Unix Administrator
TradeLink, LLC
312-264-2048
chip@trdlnk.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]