Tags:
create new tag
view all tags

KeyWords: SysAdmin, CfEngine, Solaris

Compiling and installing CfEngine 2.2.8 on Solaris 10

Alerted by a thread on the help-cfengine mailing list, I set forth to compiling cfengine from sources on our Solaris boxes, as the Blastwave.org repositories still provide the ancient version 2.1.20.

Compiling from source is not as straightforward as it should be; some issues have been found (and reported to the mailing-list, to no reaction at present).

Workarounds are recorded here for future reference.

Compilation

This is a detailed walkthrough from downloading the sources to installing the cfengine 2.2.8 binaries.

  • Download and extract the sources:
  cd /tmp
  wget http://www.cfengine.org/downloads/cfengine-2.2.8.tar.gz
  gzcat cfengine-2.2.8.tar.gz | tar xvf -

  • Install neeed development tools: assuming you have Blastwave's pkg-get installed, you can have them all with:
cd cfengine-2.2.8
# freshen the package cache contents
pkg-get -U
# install needed packages
pkg-get install binutils bison gcc4core flex openssl_devel berkeleydb4
# ensure they are found by the shell
export PATH=$PATH:/opt/csw/bin

  • Run the usual ./configure; make procedure.
./configure --prefix=/opt/cscs --with-openssl=/opt/csw/ --with-berkeleydb=/opt/csw/bdb4/ --with-gnu-ld CC=/opt/csw/gcc4/bin/gcc
Note:
  • The path to CSW OpenSSL and BerkeleyDB libraries needs to be explicitly passed to ./configure;
  • CSW's gcc4 package installs the gcc binary in a non-standard location; you need to either add /opt/csw/gcc4/bin to PATH, or explicitly set the full path to the compiler via the CC=/opt/csw/gcc4/bin/gcc argumento to ./configure;
  • The prefix has been changed from the default /usr/local (we collect all local software in /opt/cscs).
  • Option --with-gnu-ld tells ./configure that we are using an all-GNU toolchain.

  • Before issuing make, a few workarounds need to be put in place:
    • First: gcc does not understand the -pthread option; removing it from the =Makefile='s works around this bug:
find . -name Makefile | (while read file; do gsed -i -e 's/-pthread//g;' $file; done)
make clean all
    • Second: CSW installs the ar binary outside of the standard PATH, need to add it:
# need ar, non-std path
export PATH=$PATH:/opt/csw/i386-pc-solaris2.8/bin

  • Use gnutopkg to compile the sources and make a Solaris binary package. Note: gnutopkg requires that we run ./configure with any non-standard options before invocation of gnutopkg.
# compile and create a Sun package (see http://www.bolthole.com/solaris/gnutopkg)
gnutopkg 

  • Install the generated package and test the installed cfengine:
# install
pkgadd  -d cfengine-i386.pkg 
# check version and functionality
/opt/cscs/sbin/cfagent --version
/opt/cscs/sbin/cfagent -q -v -n | less

Installation

Deployment of the package on all SE's assumes that the package created above has been copied to the shared package repository as CSCS-cfengine-2.2.8.pkg, and that pdsh is installed.

# install on all hosts in one run
pdsh -R ssh -w "se[01-11]" "yes | pkgadd -d /net/adm00.lcg.cscs.ch/local2/lcg-nfs/packages/solaris/CSCS-cfengine-2.2.8-i386.pkg all 2>&1" | dshbak | less

# install symlink for cfexecd
pdsh -R ssh -w "se[01-12]" "ln -f -s /opt/cscs/sbin/cfagent /var/cfengine/bin/cfagent" | sort

# check it :-)
pdsh -R ssh -w "se[01-12]" "ls -l /var/cfengine/bin/cfagent" | sort

-- RiccardoMurri - 06 Oct 2008

Readers' comments

 
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-11-25 - RiccardoMurri
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback