Architecture #8028
closedSlackware support : rudder-agent.SlackBuild and method to build slackware package
Description
It's PoC - gruik - but functionnal
Adaptation de la documentation https://www.rudder-project.org/foswiki/Development/AgentBuild pour rudder-agent 3.2 sur slackware64 14.1
What you'll need
on SBo : lmdb perl-Module-Install rubygem-asciidoctor
asciidoctor : j'ai buildé un paquet (slackbuild en piece jointe)
wget http://www.rudder-project.org/archives/rudder-sources-3.2.0.tar.bz2
wget https://s3.amazonaws.com/cfengine-package-repos/tarballs/cfengine-3.7.1.tar.gz
wget https://github.com/fusioninventory/fusioninventory-agent/archive/2.3.6.tar.gz
mv 2.3.6.tar.gz fusioninventory-agent-2.3.6.tar.gz
mkdir files && cd files
wget http://www.normation.com/tarball/App-cpanminus-1.0004.tar.gz
wget http://www.normation.com/tarball/Archive-Extract-0.42.tar.gz
wget http://www.normation.com/tarball/Compress-Raw-Bzip2-2.027.tar.gz
wget http://www.normation.com/tarball/Compress-Raw-Zlib-2.027.tar.gz
wget http://www.normation.com/tarball/Digest-MD5-2.39.tar.gz
wget http://www.normation.com/tarball/File-Which-1.09.tar.gz
wget http://www.normation.com/tarball/HTML-Parser-3.65.tar.gz
wget http://www.normation.com/tarball/HTML-Tagset-3.20.tar.gz
wget http://www.normation.com/tarball/IO-Compress-2.027.tar.gz
wget http://www.normation.com/tarball/IPC-Run3-0.048.tar.gz
wget http://www.normation.com/tarball/Net-IP-1.25.tar.gz
wget http://www.normation.com/tarball/Probe-Perl-0.03.tar.gz
wget http://www.normation.com/tarball/Test-Script-1.07.tar.gz
wget http://www.normation.com/tarball/UNIVERSAL-require-0.13.tar.gz
wget http://www.normation.com/tarball/URI-1.56.tar.gz
wget http://www.normation.com/tarball/XML-NamespaceSupport-1.11.tar.gz
wget http://www.normation.com/tarball/XML-SAX-0.96.tar.gz
wget http://www.normation.com/tarball/XML-Simple-2.18.tar.gz
wget http://www.normation.com/tarball/XML-TreePP-0.41.tar.gz
wget http://www.normation.com/tarball/libwww-perl-5.836.tar.gz
patch detect_os.sh and perl-prepare.sh
Need to patch detect_os.sh for slackware support :
elif [ -f /etc/slackware-version ]; then
export OS="slackware"
+ export OSVERSION=$(cat /etc/slackware-version | awk '{ print $2 }')
perl-prepare.sh need to be patched to find perl module install on building host
-PERL_MM_USE_DEFAULT=1 $TMP/perl$PERL_PREFIX/bin/perl Makefile.PL --default PREFIX=$PERL_PREFIX
+PERL_MM_USE_DEFAULT=1 $TMP/perl$PERL_PREFIX/bin/perl -I /usr/share/perl5/vendor_perl Makefile.PL --default PREFIX=$PERL_PREFIX
Build package :
sh rudder-agent.SlackBuild
Slackware package /tmp/rudder-agent-3.2.0-x86_64-1_m0g.tgz created.
rudder-agent slackbuild files :
rudder-agent/0010-configure-without-pam.patch
rudder-agent/0014-fix-slack-inventory.patch
rudder-agent/README
rudder-agent/detect_os.sh
rudder-agent/doinst.sh
rudder-agent/perl-prepare.sh
rudder-agent/rudder-agent.SlackBuild
rudder-agent/rudder-agent.info
rudder-agent/slack-desc
all in rudder-agent.tgz
Files
Updated by François ARMAND about 8 years ago
- Target version changed from 4.0.0~rc2 to 4.1.0~beta1
Updated by Vincent MEMBRÉ almost 8 years ago
- Target version changed from 4.1.0~beta1 to 4.1.0~beta2
Updated by Vincent MEMBRÉ almost 8 years ago
- Target version changed from 4.1.0~beta2 to 4.1.0~beta3
Updated by Vincent MEMBRÉ almost 8 years ago
- Target version changed from 4.1.0~beta3 to 4.1.0~rc1
Updated by François ARMAND almost 8 years ago
- Target version changed from 4.1.0~rc1 to 4.2.0~beta1
Updated by Alexis Mousset over 7 years ago
- Target version changed from 4.2.0~beta1 to 4.2.0~beta2
Updated by Vincent MEMBRÉ over 7 years ago
- Target version changed from 4.2.0~beta2 to 4.2.0~beta3
Updated by Vincent MEMBRÉ over 7 years ago
- Target version changed from 4.2.0~beta3 to 4.2.0~rc1
Updated by Jérémy HOCDÉ over 7 years ago
Build rudder-agent 4.1.5 on slackware64 14.2
requires : lmdb (disponible sur slackbuild.org)
Get sources :
wget http://www.rudder-project.org/archives/rudder-sources-4.1.5.tar.bz2
Get SBo archive (in attacment issue 8028)
tar xzf rudder-agent-4.1.5_SBo.tar.gz
archive contents :
Makefile # Makefile patched
README # this file
build_rudder-agent.log # logs from slackbuild script
doinst.sh # post-installation script (need by slackware packages)
rudder-agent.SlackBuild # Script to build package
rudder-agent.info # Application informations (need by SBo)
rudder-packages_rudder-agent_SOURCES_Makefile.patch # Patch for Makefile
slack-desc # Package description (need by slackware packages)
What does the rudder-packages_rudder-agent_SOURCES_Makefile.patch ?
- create a directory for fusioninventory :
- check if system is slackware and set --with-pam=no --without-pam into configure of cfengine
Build package :
cd rudder-agent
sh rudder-agent.SlackBuild
press the button of the coffee machine
wait (7 mins on my vm)
Install package :
installpkg /tmp/rudder-agent-4.1.5-x86_64-1_SBo.tgz
Initiate agent :
echo "rudder.server" > /var/rudder/cfengine-community/policy_server.dat
Start agent :
/etc/rc.d/rc.rudder-agent start
What can we do with a node with this package ?
- Add node into rudder server
- Get policies from rudder server
- Use directive like ''' Ditributing file > File content '''
- Use rudder agent methods (little bugs with restart services)
- Surely other things
What cannot we do for the moment ?
- Have de compliance report of the node
- Install package with a directive
- Surely other things
What next ?
I work on two problems :
- bugs when agent try to restart services
On slackware, there are no init script for cron, it's just start with system
I have make one for test but I don't think cfengine understand what init scripts are into /etc/rc.d and named rc.<SERVICE_NAME>
I look at cron-setup.cf and restart_services.cf into common/1.0 but I could not find where or what modify to tell cfengine
I saw that cfengine supports slackware in Operating System Classes (https://docs.cfengine.com/docs/master/reference-language-concepts-classes.html)
but at this point I'm blocked
- have a report from the node
Slackware 14.2 use sysklogd 1.5.1 and I think it's maybe the problem
It's possible to build syslog-ng or rsyslog. So I need to know which of them is the more efficient for rudder-agent
:o)
Thks a lot to Normation
Your work into the Makefile make my life easier !!
Updated by Jérémy HOCDÉ over 7 years ago
I have installed rsyslog 8.26.0 and it's the same :(
when I run agent, it detect changing configuration and create /etc/rsyslog.d/rudder-agent.conf :o)
I have into my logs /var/log/messages
Jul 28 18:08:45 sbo-packaging rudder10611: CFEngine(agent) rudder R: @Common
@log_info@hasPolicyServer-root
@common-root@1
@common@StartRun
@2017-07-28 16:08:44+00:00##12345678-90ab-cdef-1234-567890abcdef@#Start execution with config [20170728-154928-47097d5d]
Jul 28 18:08:45 sbo-packaging rudder10611: CFEngine(agent) rudder R: @Common
@result_success@hasPolicyServer-root
@common-root@1
@ncf Initialization@None
@2017-07-28 16:08:44+00:00##12345678-90ab-cdef-1234-567890abcdef@#Configuration library initialization was correct
Jul 28 18:08:45 sbo-packaging rudder10611: CFEngine(agent) rudder R: @Common
@result_success@hasPolicyServer-root
@common-root@1
@Security parameters@None
@2017-07-28 16:08:44+00:00##12345678-90ab-cdef-1234-567890abcdef@#The internal environment security is acceptable
.....
rsyslog config file :
#Rudder log system
$RepeatedMsgReduction off
if $syslogfacility-text 'local6' and $programname startswith 'rudder' then @rudder.asacode.lab:5514
if $syslogfacility-text 'local6' and $programname startswith 'rudder' then ~
if $syslogfacility-text 'local6' and $programname startswith 'cf-agent' then @rudder.asacode.lab:5514
if $syslogfacility-text 'local6' and $programname startswith 'cf-agent' then ~
but it don't seem to be sent to rudder server
to be continue...
Updated by Jérémy HOCDÉ over 7 years ago
little update: the lmdb requirement is only need to build package not in the run :D
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 4.2.0~rc1 to 4.2.0~rc2
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 4.2.0~rc2 to 4.2.0
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 4.2.0 to 4.2.1
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 4.2.1 to 4.2.2
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 4.2.2 to 4.2.3
Updated by Vincent MEMBRÉ almost 7 years ago
- Target version changed from 4.2.3 to 4.2.4
Updated by Benoît PECCATTE almost 7 years ago
- Target version changed from 4.2.4 to Ideas (not version specific)
Updated by Alexis Mousset over 5 years ago
- Status changed from New to Rejected
Slackware support is present since 4.3, closing.