Adding an optional LCFG "feature"

In LCFG Linux releases prior to FC3 (Fedora Core 3), almost all LCFG components were configured on all machines; this was done even for components which were only used on a small number of machines.

For FC3, the concept of a base LCFG platform has been introduced. Only core components which are likely to be used on all machines at all LCFG sites are configured by default. Additional components are added either by including options headers in individual machine profiles, or by including site wide in an individual sites' defaults.h header.

This page explains how to add a new LCFG "feature".

Example - NFS server feature

It is unlikely that many sites will require all their machines to export filesystems over NFS, so configuring the NFS server is consided an optional LCFG "feature".

Adding the NFS server feature involves adding the NFS component to the profile, adding appropriate boot and logserver component resources, configuring the nfs initd script and adding any site (eg DICE) specific resources.

Three files need creating :-

  • <lcfg/defaults/nfs.h>
  • <lcfg/options/nfs-server.h>
  • <dice/options/nfs-server.h>

Once these files have been created, adding #include <dice/options/nfs-server.h> to a machine's profile will add the NFS feature to that machine.

<lcfg/defaults/nfs.h>

The <lcfg/defaults/nfs.h> file includes resources required to add the NFS component to the profile and start the component (and NFS server daemons) at system boot. This file would never be cited in an individual machine's profile.

/************************************************************************
  nfs defaults
 ************************************************************************/

!profile.components     mADD(nfs)
profile.version_nfs     2

!logserver.components   mADD(nfs)

!boot.services          mADD(lcfg_nfs rc_nfs)
boot.start_lcfg_nfs     101 restart
boot.start_rc_nfs       102 restart

<lcfg/options/nfs-server.h>

The <lcfg/options/nfs-server.h> is used to provide the NFS server feature at the LCFG level.

The NFS component defaults are included, and the tcpwrappers component configured to allow access to the rpc.mountd daemon from any machine in the current domain. The RPM containing the component code is also specified.

/* Options header for providing NFS service */

#ifndef LCFG_OPTIONS_NFS_SERVER
#define LCFG_OPTIONS_NFS_SERVER

#include <lcfg/defaults/nfs.h>

/* Default is to allow mounts from anywhere in local domain */

!tcpwrappers.allow           mADD(mountd)
!tcpwrappers.allow_mountd    mSET(mountd : *._DOMAIN)

/* Add the component RPM */
!profile.packages            mADD(lcfg-nfs-1.0.*-*)

#endif

<dice/options/nfs-server.h>

The <dice/options/nfs-server.h> file is the header that DICE machines should cite to add NFS server functionality. It includes the LCFG level option file and adds some DICE specific resources, such as a default export of /disk/home/HOSTNAME

/* DICE Options header for providing NFS service */

#ifndef DICE_OPTIONS_NFS_SERVER
#define DICE_OPTIONS_NFS_SERVER

#include <lcfg/options/nfs-server.h>

!nfs.exports            mSET(home)
nfs.fs_home             /disk/home/HOSTNAME
nfs.options_home        @HOST_managed(rw)

/* Allow all EdLAN machines */

!tcpwrappers.allow_mountd       mSET(mountd : 129.215.0.0/255.255.0.0)

#endif

-- AlastairScobie - 17 Aug 2005

Topic revision: r4 - 16 Nov 2005 - 16:08:05 - AlastairScobie
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies