Project

General

Profile

Actions

Architecture #2542

closed

Architecture #2519: Upgrade CFEngine to 3.4.x

rudder-agent packages need new library to build CFEngine 3.4.2

Added by Nicolas PERRON almost 12 years ago. Updated about 9 years ago.

Status:
Released
Priority:
1
Category:
Packaging
Target version:
Effort required:
Name check:
Fix check:
Regression:

Description

Building CFEngine 3.3.3 need a new package to be installed:

checking for tchdbnew in -ltokyocabinet... no
configure: error: Cannot find Tokyo Cabinet

RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.PRgRXH (%build)
    Bad exit status from /var/tmp/rpm-tmp.PRgRXH (%build)
make: *** [buildpackage-rpm-common-build] Error 1

Pull Request URL: https://github.com/Normation/rudder-packages/pull/19


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #3302: Remove '%install' from comments in rudder-agent.spec files since rpmbuild parser consider it as instructionsReleasedNicolas PERRON2013-02-21Actions
Has duplicate Rudder - Bug #2646: rudder-agent is missing a build dependency on tokyo cabinetRejectedMichael Gliwinski2012-07-09Actions
Actions #1

Updated by Nicolas PERRON almost 12 years ago

On Ubuntu, the package needed is : libtokyocabinet-dev
We need the packages for Ubuntu 12.04 & 11.10, Debian 5 & 6, SLES11 and RHEL/CentOS6

Actions #2

Updated by Jonathan CLARKE almost 12 years ago

This does not seem trivial: CFEngine requires TokyoCabinet >= 1.4.42, which doesn't seem to be provided by many of our target OSes... See https://cfengine.com/manuals/cf3-Reference#Installation.

Actions #3

Updated by Nicolas PERRON almost 12 years ago

  • Status changed from New to Discussion

Jonathan CLARKE wrote:

This does not seem trivial: CFEngine requires TokyoCabinet >= 1.4.42, which doesn't seem to be provided by many of our target OSes... See https://cfengine.com/manuals/cf3-Reference#Installation.

Ok, so what should we do ? Continue to try building CFEngine 3.3.3 with all supported OS ? Only build CFEngine 3.3.3 on recent OS ? Rollback to CFEngine 3.2.0 ?

Actions #4

Updated by Jonathan CLARKE almost 12 years ago

  • Status changed from Discussion to New
  • Assignee deleted (Matthieu CERDA)
  • Target version changed from 46 to 24

This is going to be paused for now. Our time frame for the 2.5 release does not obviously leave enough time to setup new packages for this, and the benefits of using CFEngine 3.3.x are not that great from Rudder's point of view - for now.

I'm going to be reverting the change for #2519 (upgrading to CFEngine 3.3.3) and going to a 3.2.x version instead.

Actions #5

Updated by Jonathan CLARKE almost 12 years ago

  • Assignee set to Matthieu CERDA
  • Target version changed from 24 to 48
Actions #6

Updated by Jonathan CLARKE almost 12 years ago

  • Assignee deleted (Matthieu CERDA)
Actions #7

Updated by Jonathan CLARKE almost 12 years ago

  • Target version changed from 48 to 24
Actions #8

Updated by Nicolas CHARLES over 11 years ago

  • Assignee set to Matthieu CERDA
  • Priority changed from 2 to 1

The dependency for CFEngine 3.3+ is TokyoCabinet 1.4.42 or later
It is not available as a prebuild package for most distro, but the sources are here : http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz

Building it is fairly straightforward :
Get the dependency to bzip2-dev (apt-get install libbz2-dev on a Ubuntu/Debian)
Then

./configure
make
sudo make install

Once this has been done, the standart build procedure for CFEngine package can be applied
The latest stable CFEngine is 3.3.8 : http://cfengine.com/source-code/download?file=cfengine-3.3.8.tar.gz

Actions #9

Updated by Nicolas CHARLES over 11 years ago

  • Target version changed from 24 to 2.5.0~beta1
Actions #10

Updated by Jonathan CLARKE over 11 years ago

I asked on the CFEngine mailing lists, and it seems we can use the TokyoCabinet version included in Debian 6 and CentOS 6 (at least) : https://groups.google.com/forum/?fromgroups=#!topic/help-cfengine/JqowRGwFGNE.

This will save us creating our own package, and having to maintain packaging for (yet another) third party project.

Actions #11

Updated by Nicolas PERRON over 11 years ago

  • Target version changed from 2.5.0~beta1 to 2.5.0~rc1
Actions #12

Updated by Jonathan CLARKE over 11 years ago

  • Target version changed from 2.5.0~rc1 to 2.6.0~beta1
Actions #13

Updated by Matthieu CERDA about 11 years ago

Work on this is in progress.

Actions #14

Updated by Nicolas PERRON about 11 years ago

It seems that all necessary libraries to compile tokyocabinet are available on supported OS for Rudder:
  • CentOS 5
    • zlib-devel
    • bzip2-devel
  • CentOS 6
    • zlib-devel
    • bzip2-devel
  • SLES 10
    • no package for bzlib as there are system based
    • zlib-devel
  • SLES 11
    • libbz2-devel
    • zlib-devel
  • Debian/Ubuntu
    • zlib1g-dev
    • libbz2-dev

We (Matthieu and me) suggests to install CFE in a Rudder folder: /opt/rudder/lib

export WORKSPACE=$(mktemp -d) && cd ${WORKSPACE}
curl http://fallabs.com/tokyocabinet/tokyocabinet-1.4.48.tar.gz | tar xzf -
cd tokyocabinet-1.4.48
./configure --prefix=/opt/rudder
make
make install

After, compiling CFEngine with tokyocabinet library is easy since its location is in /opt/rudder/lib/:

./configure --build=%_target --prefix=%{rudderdir} --with-workdir=%{ruddervardir}/cfengine-community --enable-static=yes --enable-shared=no --with-tokyocabinet=/opt/rudder
Actions #15

Updated by Nicolas PERRON about 11 years ago

  • Subject changed from rudder-agent and rudder-cfengine-community packages need new library to build CFEngine 3.3.3 to rudder-agent and rudder-cfengine-community packages need new library to build CFEngine 3.4.2

The goal is to build CFEngine 3.4.2, instead of 3.3.3.

Actions #16

Updated by Nicolas PERRON about 11 years ago

  • Tracker changed from Bug to 6

This is not a bug but an integration implementation.

Actions #17

Updated by Nicolas PERRON about 11 years ago

  • Status changed from New to In progress
  • Assignee changed from Matthieu CERDA to Nicolas PERRON
Actions #18

Updated by Nicolas PERRON about 11 years ago

Nicolas PERRON wrote:

It seems that all necessary libraries to compile tokyocabinet are available on supported OS for Rudder:
  • CentOS 5
    • zlib-devel
    • bzip2-devel
  • CentOS 6
    • zlib-devel
    • bzip2-devel
  • SLES 10
    • no package for bzlib as there are system based
    • zlib-devel
  • SLES 11
    • libbz2-devel
    • zlib-devel
  • Debian/Ubuntu
    • zlib1g-dev
    • libbz2-dev

We (Matthieu and me) suggests to install CFE in a Rudder folder: /opt/rudder/lib

If we install tokyocabinet in /opt/rudder/lib, it will be there only we compile it. The OS with tokyocabinet packages will have the library in /usr/lib as usual.

A difficulty I have to dealt with (at least with SPEC files) is to specify to compile tokyocabinet and CFEngine with alternate tokyocabinet library path ONLY if this is on:
  • CentOS 5
  • SLES 10
  • SLES 11
Actions #19

Updated by Nicolas PERRON about 11 years ago

  • Status changed from In progress to Discussion
  • Assignee changed from Nicolas PERRON to Jonathan CLARKE

Jon,

I have found a solution to deal with conditionnal compilation of CFE 3.4.2 in the SPEC file (condition is: does the OS contain tokyocabinet package) but I don't know how to deal with the same problem with Debian.

In the Debian/Ubuntu version supported by Rudder, only Lenny does not have tokyocabinet package but it seems to me that it is not possible to do conditions with distribution and/or versions into the debian/rules and debian/control files.

Besides, we install tokyocabinet library in /opt/rudder/lib if it is compiled but this can't be the same on a system which doesn't require a compilation.

Should we force compilation of tokyocabinet on all OSes ? It would be easier and the library would always be located in /opt/rudder whatever is the OS.

Actions #20

Updated by Jonathan CLARKE about 11 years ago

  • Assignee changed from Jonathan CLARKE to Nicolas PERRON

It seems to me that it's not possible in a debian/control file to say something like "if this is Debian <= 5, don't depend on this, but if this is Debian >= 6, then depend on tokyocabinet".

Therefore, I suggest a different approach:
  • We modify our debian/control and .spec files to support the "standard" case: recent OSes that include TokyoCabinet.
  • We also provide a patch for debian/* and .spec files to adapt them for the older OSes that don't include TokyoCabinet, where we have to compile them ourselves. Our packaging Makefiles can test this condition and apply the patch if necessary before building.
Actions #21

Updated by Nicolas PERRON about 11 years ago

  • Description updated (diff)
Actions #22

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Discussion to Pending technical review
Actions #23

Updated by Nicolas PERRON about 11 years ago

  • Status changed from Pending technical review to In progress
  • % Done changed from 0 to 90

The build seems to work at least for SLES 10 but the update have some problems:

sles-10-sp3-64:~ # rpm -Uvh rudder-agent-2.6.0.alpha1.git-1.x86_64.rpm 
Préparation...              ########################################### [100%]
   1:rudder-agent           attention: /opt/rudder/etc/uuid.hive créé en tant que /opt/rudder/etc/uuid.hive.rpmnew
########################################### [100%]
rudder-agent[26081]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[26084]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[26085]: [INFO] Halting CFEngine Community cf-serverd...
rudder-agent[26089]: [OK] CFEngine Community cf-serverd stopped after 2 seconds
rudder-agent[26090]: [INFO] Halting CFEngine Community cf-execd...
rudder-agent[26094]: [OK] CFEngine Community cf-execd stopped after 2 seconds
CFEngine binaries copied to workdir
rudder-agent[26109]: [INFO] Using /etc/default/rudder-agent for configuration
rudder-agent[26112]: [INFO] Using /var/rudder/cfengine-community for CFEngine workdir
rudder-agent[26113]: [INFO] Launching CFEngine Community cf-serverd...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!

rudder-agent[26316]: [ALERT] no PID file for cf-serverd after 30 seconds. Trying again...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!
rudder-agent[26438]: [ALERT] no PID file for cf-serverd after 60 seconds. Trying again...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!
rudder-agent[26501]: [ALERT] no PID file for cf-serverd after 70 seconds
rudder-agent[26502]: [INFO] Launching CFEngine Community cf-execd...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!
rudder-agent[26622]: [ALERT] no PID file for cf-execd after 30 seconds. Trying again...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!
rudder-agent[26744]: [ALERT] no PID file for cf-execd after 60 seconds. Trying again...
Fatal cfengine error: UNTRUSTED: Private key directory /var/rudder/cfengine-community/ppkeys (mode 755) was not private!
rudder-agent[26787]: [ALERT] no PID file for cf-execd after 70 seconds
sles-10-sp3-64:~ #
sles-10-sp3-64:~ # rug se rudder

S | Catalogue       | Ensemble | Nom          | Version            | Arch  
--+-----------------+----------+--------------+--------------------+-------
i | System packages |          | rudder-agent | 2.6.0.alpha1.git-1 | x86_64

sles-10-sp3-64:~ # /var/rudder/cfengine-community/bin/cf-agent -V

   @@@      
   @@@      cf-agent

 @ @@@ @    CFEngine Core 3.2.0
 @ @@@ @    
 @ @@@ @    
 @     @    
   @@@      
   @ @      
   @ @      
   @ @      

Copyright (C) Cfengine AS 2008-2011
sles-10-sp3-64:~ # /opt/rudder/bin/cf-agent -V

   @@@      
   @@@      cf-agent

 @ @@@ @    CFEngine Core 3.4.2
 @ @@@ @    
 @ @@@ @    
 @     @    
   @@@      
   @ @      
   @ @      
   @ @      

Copyright (C) CFEngine AS 2008-2013
See Licensing at http://cfengine.com/3rdpartylicenses
Actions #24

Updated by Jonathan CLARKE about 11 years ago

  • Subject changed from rudder-agent and rudder-cfengine-community packages need new library to build CFEngine 3.4.2 to rudder-agent packages need new library to build CFEngine 3.4.2

It looks like you need to add a chmod to your postinst scripts, to fix the perms on /var/rudder/cfengine-community/ppkeys.

Actions #25

Updated by Nicolas PERRON about 11 years ago

  • Status changed from In progress to Pending technical review
  • % Done changed from 90 to 100

The Pull Request has been updated in order to take in account every comments.

The patches for RPM has been removed and conditionnals used in the .spec file instead.

Actions #26

Updated by Nicolas PERRON about 11 years ago

  • File 0001-Fixes-2632-Add-script-to-detect-OS-and-modify-packag.patch added

In attachement is the patch to apply on packaging repository.

Could you review it Jon, please ?

Actions #27

Updated by Nicolas PERRON about 11 years ago

  • File deleted (0001-Fixes-2632-Add-script-to-detect-OS-and-modify-packag.patch)
Actions #28

Updated by Nicolas PERRON about 11 years ago

Nicolas PERRON wrote:

In attachement is the patch to apply on packaging repository.

Could you review it Jon, please ?

Oops, wrong ticket.

Actions #29

Updated by Nicolas PERRON about 11 years ago

Jon, I've updated the PR. Could you review it, please ?

Actions #30

Updated by Nicolas PERRON about 11 years ago

  • Assignee changed from Nicolas PERRON to Jonathan CLARKE
Actions #31

Updated by Nicolas PERRON about 11 years ago

PR updated

Actions #32

Updated by Nicolas PERRON about 11 years ago

A reabse of all the commits in the validated PR has been made. The PR is ready to be merged.

Actions #33

Updated by Nicolas PERRON about 11 years ago

  • Project changed from Rudder to 34
  • Category deleted (11)
Actions #34

Updated by Nicolas PERRON about 11 years ago

The PR have been merged, is this normal that I cannot change the state ?

Actions #35

Updated by Jonathan CLARKE about 11 years ago

  • Status changed from Pending technical review to 12

Nicolas PERRON wrote:

The PR have been merged, is this normal that I cannot change the state ?

The ticket was not automatically changed because your commit messages said "Refs #nnnn" instead of "Fixes #nnnn".

You can not change status from "Pending technical review" as you are not a project leader so don't have the permissions to do this. I've changed it.

Actions #36

Updated by Jonathan CLARKE about 11 years ago

  • Status changed from 12 to Pending release
Actions #37

Updated by Nicolas PERRON about 11 years ago

  • Parent task set to #2519
Actions #38

Updated by Jonathan CLARKE about 11 years ago

  • Status changed from Pending release to Released

This ticket has been addressed in version 2.6.0~beta1 of Rudder, which has just been released. Please see the changelog here: https://www.rudder-project.org/foswiki/System/Documentation:ChangeLog26.

Actions #39

Updated by Benoît PECCATTE about 9 years ago

  • Category set to Packaging
Actions #40

Updated by Benoît PECCATTE about 9 years ago

  • Tracker changed from 6 to Architecture
Actions

Also available in: Atom PDF