help-cfengine
[Top][All Lists]
Advanced

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

Maintaining RC symlinks


From: Chip Seraphine
Subject: Maintaining RC symlinks
Date: Wed, 9 Jun 2004 13:04:15 -0500
User-agent: KMail/1.5.4

I'm getting ready to write  a script for turning on and off SVR4-style start/
kill symlinks to init.d scripts (think chkconfig, but less friendly).  Before 
I reinvent any wheels, I was wondering if anybody wants to share any really 
clever solutions or ideas for adding/removing links...

To provide a baseline, here is what I am currently doing:

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).  

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)'"


... and the cfservice script will detect the 'service_mysqlserver' script and 
Do The Right Thing (which will probably be running chkconfig on Linux hosts, 
or explicitly setting/removing links on others)  for every service (i.e. 
script in init.d) that does or does not have a corresponding service_* class 
defined.

The second approach is nonconvergent and requires me to write Yet Another 
External Script, so I find it only marginally preferable to the first one.  
Anybody out there has something better?

-- 

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





reply via email to

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