Suggestion: Break out hobbitlaunch config directives into a directory

Cleaver, Japheth jcleaver at soe.sony.com
Sat Feb 27 01:14:12 CET 2010


This is something we do in our packages over here to allow easier patching and customization later on (and for packages to drop their own hobbitlaunch configurations in in a defined manner). Since Xymon will follow “directory” directives and include all files underneath it, it’s easy to follow the standard conf.d methodology here.

 

Here’s some code from our RPM that does this automatically. It might not completely work for you, but its intent should be clear. Any chance we could get Xymon broken out like this in its default state?

 

Regards,

 

Japheth Cleaver

jcleaver at soe.sony.com

 

 

=== snip ===

 

###############################################################################

# Break out our server's hobbitlaunch.cfg file into seperate files in 

# a directory (for better future package management)

# 

# Exception: Rename hobbitd to _hobbitd so that it loads first

#  This way, if hobbitd *isn't* running (eg, on a bbproxy machine)

#  it will be noted first and all of the NEEDS blocks will work properly.

# 

  install -d %{buildroot}%{_sysconfdir}/%{serverName}/launch.d

  pushd %{buildroot}%{_sysconfdir}/%{serverName}/launch.d/

     %{__perl} -e "\$/='';while (<>) { \$_ .= <> while not (m#\n\[([\w+._-]+)\]#s || eof);open (FILE,'>',\$1); print FILE \$_; };" ../hobbitlaunch.cfg

     mv hobbitd _hobbitd

  popd

 

  echo "#

# The hobbitlaunch.cfg file is loaded by hobbitlaunch.

# It controls which of the Xymon modules to run, how often, and

# with which parameters, options and environment variables.

#

 

directory launch.d/" > %{buildroot}%{_sysconfdir}/%{serverName}/hobbitlaunch.cfg

 

###############################################################################

# Do the same for the client's clientlaunch.cfg file into separate files in 

# a directory (for better future package management)

# 

  install -d %{buildroot}%{_sysconfdir}/%{clientName}/launch.d

  pushd %{buildroot}%{_sysconfdir}/%{clientName}/launch.d/

     %{__perl} -e "\$/='';while (<>) { \$_ .= <> while not (m#\n\[([\w+._-]+)\]#s || eof);open (FILE,'>',\$1); print FILE \$_; };" ../clientlaunch.cfg

  popd

 

  echo "#

# The clientlaunch.cfg file is loaded by "hobbitlaunch".

# It controls which of the Hobbit client-side modules to run, 

# (both the main client "hobbitclient.sh" and any client-side

# extensions); how often, and with which parameters, options 

# and environment variables.

#

# Note: On the Hobbit *server* itself, this file is normally 

#       NOT used. Instead, both the client- and server-tasks

#       are controlled by the hobbitlaunch.cfg file.

#

 

directory launch.d/" > %{buildroot}%{_sysconfdir}/%{clientName}/clientlaunch.cfg

 

=== snip ===

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100226/9643b56d/attachment.html>


More information about the Xymon mailing list