cfengine3 promises not updating

For those of you using a ‘non-standard’ installation of cfengine3 and wondering why your promises are only updating when you bootstrap – the Community promises use an absolute path pointed at /var/cfengine

A simple fix is to create a symlink in /var to your installation.

$
ln -sf /usr/local/var/cfengine /var/cfengine

Hopefully this will save someone a few hours of bashing their head against the wall.

Building cfengine3 on Slackware

Getting cfengine running on slackware (and slackwarearm) is relatively straight-forward.

These instructions are obviously assuming your system is configured to build from source, and that you keep non-base slackware packages in /usr/local

First, you’ll need to install tokyocabinet.

$
cd /usr/local/src
wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz
tar xfvz tokyocabinet-1.4.48.tar.gz
cd tokyocabinet-1.4.48
./configure --prefix=/usr/local
make
make install
ldconfig

Then, build cfengine3.

$
cd /usr/local/src
wget http://cfengine.com/source-code/download?file=cfengine-3.5.3.tar.gz -O cfengine-3.5.3.tar.gz
cd cfengine-3.5.3
./configure --prefix=/usr/local
make
make install

Next, create symlinks to the cfengine binaries.

$
cd /usr/local/var/cfengine/bin
for $fnord in /usr/local/bin/cf-*
do
ln -sf $fnord .
done

Lastly, start the cfengine services:

$
cf-monitord
cf-execd
cf-serverd

From there, you’ll probably want create an init script and add it to your /etc/rc.d/rc.local

Slackware init script for cfengine3

#!/bin/sh
# Start/stop/restart cfengine3.

# Set cfengine3 working directory
CFDIR="/usr/local/var/cfengine"

# Start cfengine3 daemons:
cfengine_start() {
  CFMONITORD="$CFDIR/bin/cf-monitord"
  CFEXECD="$CFDIR/bin/cf-execd"
  CFSERVERD="$CFDIR/bin/cf-serverd"

pgrep cf-monitord | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-monitord is running."
  else
    echo "Starting cf-monitord:  $CFMONITORD"
    $CFMONITORD
  fi

pgrep cf-execd | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-execd is running."
  else
    echo "Starting cf-execd:  $CFEXECD"
    $CFEXECD
  fi

pgrep cf-serverd | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-serverd is running."
  else
    echo "Starting cf-serverd:  $CFSERVERD"
    $CFSERVERD
  fi
}

# Stop cfengine3 daemons:
cfengine_stop() {
echo "Stopping cf-execd..."
  if [ -r $CFDIR/cf-execd.pid ]; then
    kill -9 $(cat $CFDIR/cf-execd.pid)
    rm -f $CFDIR/cf-execd.pid
  else
    killall cf-execd
  fi
echo "Stopping cf-monitord..."
  if [ -r $CFDIR/cf-monitord.pid ]; then
    kill -9 $(cat $CFDIR/cf-monitord.pid)
    rm -f $CFDIR/cf-monitord.pid
  else
    killall cf-monitord
  fi
echo "Stopping cf-serverd..."
  if [ -r $CFDIR/cf-serverd.pid ]; then
    kill -9 $(cat $CFDIR/cf-serverd.pid)
    rm -f $CFDIR/cf-serverd.pid
  else
    killall cf-serverd
  fi
}

# Restart cfengine3 daemons:
cfengine_restart() {
  cfengine_stop
  sleep 1
  cfengine_start
}

# Check if cfengine3 daemons are running
cfengine_status() {
pgrep cf-serverd | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-serverd is running."
  else
    echo "cf-serverd is stopped."
  fi

pgrep cf-monitord | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-monitord is running."
  else
    echo "cf-monitord is stopped."
  fi

pgrep cf-execd | grep -v $$ | grep -q -v $PPID
if [ $? -eq 0 ]; then
    echo "cf-execd is running."
  else
    echo "cf-execd is stopped."
  fi
exit 1
}

case "$1" in
'start')
  cfengine_start
  ;;
'stop')
  cfengine_stop
  ;;
'restart')
  cfengine_restart
  ;;
'status')
  cfengine_status
  ;;
*)
  echo "usage $0 start|stop|restart|status"
esac

Slackware 14.0 Released

Congratulations and many thanks to the Slackware team for yet another ironclad release!

Pat’s comments from the changelog:

Wed Sep 26 01:10:42 UTC 2012
Slackware 14.0 x86 stable is released!

We’re perfectionists here at Slackware, so this release has been a long
time a-brewing.  But we think you’ll agree that it was worth the wait.
Slackware 14.0 combines modern components, ease of use, and flexible
configuration… our “KISS” philosophy demands it.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We’re taking
pre-orders now, and offer a discount if you sign up for a subscription.

Thanks to everyone who helped make this happen.  The Slackware team, the
upstream developers, and (of course) the awesome Slackware user community.

Have fun!  :-)

As always, if you’re ready to take the plunge, take a look at Pat’s UPGRADE.TXT and Robby Workman’s CHANGES_AND_HINTS.TXT to ensure a painless transition from 13.37 to 14.0

Happy Slacking this weekend.