<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sébastien Wains</title>
	<atom:link href="http://blog.wains.be/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.wains.be</link>
	<description>On Linux, Open Source, VoIP and other geeky stuff</description>
	<lastBuildDate>Sat, 13 Apr 2013 21:06:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Salt Stack, a (serious) alternative to Puppet</title>
		<link>http://blog.wains.be/2013/04/05/salt-stack-a-serious-alternative-to-puppet/</link>
		<comments>http://blog.wains.be/2013/04/05/salt-stack-a-serious-alternative-to-puppet/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 07:37:09 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1301</guid>
		<description><![CDATA[I couldn&#8217;t write it better : see http://www.lecloud.net/post/29325359938/salt-to-the-rescue So basically, Salt is a configuration management system (à la Puppet) and allows remote execution (à la Rundeck). First thing first, it is very easy to install. I know Puppet now offers repositories &#8230; <a href="http://blog.wains.be/2013/04/05/salt-stack-a-serious-alternative-to-puppet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I couldn&#8217;t write it better : see <a href="http://www.lecloud.net/post/29325359938/salt-to-the-rescue" target="_blank">http://www.lecloud.net/post/29325359938/salt-to-the-rescue</a></p>
<p>So basically, Salt is a configuration management system (à la Puppet) and allows remote execution (à la Rundeck).</p>
<p>First thing first, it is very easy to install. I know Puppet now offers repositories and it&#8217;s probably as easy, but Salt is just a package with a couple of dependencies. Actually to achieve the same tasks you have to have Puppet and Mcollective, which are still two distinct products. Salt does the job from one package.</p>
<p>Then, it&#8217;s based on Python, YAML and Jinja.</p>
<p>The documentation is very good, and the community very active (got answers within 30 seconds in #salt on Freenode).</p>
<p>The last thing I like : minions keep a constant connection to the master. You can push  changes to minions immediately. I attended the Puppet Fundamentals training late last year and asked about a &#8220;push&#8221; of changes instead of a &#8220;pull&#8221;. It seems like there&#8217;s a solution but the trainer couldn&#8217;t get it working.</p>
<p>One thing they could improve is the frontpage of their site. When you go to http://www.saltstack.org you are redirected to http://saltstack.com/community.html instead of http://saltstack.com/about.html which explains what the product does.</p>
<p>Installation (RHEL) :</p>
<p>Server :</p>
<p>yum &#8211;enablerepo=epel install salt-master</p>
<p>Edit /etc/salt/master</p>
<pre>file_roots:
  base:
    - /srv/salt
  dev:
    - /srv/salt/dev
  prd:
  - /srv/salt/prd

pillar_roots:
  base:
  - /srv/pillar</pre>
<p>service salt-master restart</p>
<p>Client :</p>
<pre>yum --enablerepo install salt-minion</pre>
<p>Edit /etc/salt/minion</p>
<pre>master: your.master.server.example.org</pre>
<p>service salt-minion restart</p>
<p>Now you should see a pending key with &#8220;salt-key&#8221;. See &#8220;salt-key -h&#8221; for more info.</p>
<p>Basically, modules are called &#8220;states&#8221;.</p>
<p>Pillars are kind of variables you can use in your files.</p>
<p>This is the content of /srv on my master :</p>
<p>.<br />
./pillar<br />
./salt<br />
./salt/prd<br />
./salt/dev<br />
./salt/sandbox<br />
./salt/sandbox/motd<br />
./salt/sandbox/ntpd<br />
./salt/sandbox/apache<br />
./salt/sandbox/sshd<br />
./salt/sandbox/snmpd<br />
./salt/acc<br />
./salt/common<br />
./salt/common/groups<br />
./salt/common/users<br />
./salt/common/packages<br />
./salt/common/files<br />
./salt/common/sudo</p>
<p>I have 5 environments :<br />
- sandbox : where I develop states<br />
- dev : development servers<br />
- acc : staging servers<br />
- prd : production servers<br />
- common : states common to all environments (sshd, snmpd, etc.)</p>
<p>If you look in /etc/salt/master, you&#8217;ll see there&#8217;s a &#8220;base&#8221; environment. This is where your top.sls (the key component of your salt architecture) will reside :</p>
<pre># cat /srv/salt/top.sls
common:
  '*':
    - packages
    - users
    - groups
    - files
    - sudo

dev:
  '*.dev.example.org':
    - dev

acc:
  '*.acc.example.org':
    - acc

prd:
  '*.prd.example.org':
    - prd

sandbox:
  'salt-client*':
    - motd
    - apache
    - ntpd
    - snmpd
    - sshd</pre>
<p>You can see I started working with Salt only a couple of days ago. My states are still in the &#8220;sandbox&#8221; environment.</p>
<p>How you can push states to minions :</p>
<p>salt &#8216;*&#8217; state.highstate</p>
<p>/srv/pillar/top.sls</p>
<pre>base:
'*':
- convention-os</pre>
<p>/srv/pillar/convention-os.sls</p>
<pre>convention-os:
  pkg:
    {% if grains['os_family'] == 'RedHat' %}
      apache: httpd
      snmpd: net-snmp
      vim: vim-enhanced
    {% elif grains['os_family'] == 'Debian' %}
      apache: apache2
      snmpd: snmpd
      vim: vim
    {% endif %}
  service:
    {% if grains['os_family'] == 'RedHat' %}
      apache: httpd
      ntpd: ntpd
      sshd: sshd
    {% elif grains['os_family'] == 'Debian' %}
      apache: apache2
      ntpd: ntp
      sshd: ssh
    {% endif %}</pre>
<p>States can be named this way /srv/salt/env/motd.sls or /srv/salt/env/motd/init.sls<br />
I tend to prefer the later.</p>
<p>Here&#8217;s an example of state calling pillars :</p>
<pre>apache:
  pkg:
    - installed
    - name: {{ pillar['convention-os']['pkg']['apache'] }}
  service:
    - running
    - name: {{ pillar['convention-os']['service']['apache'] }}</pre>
<p>This is a pretty rough post, sorry about that. I just wanted to spread the word about Salt and hope you&#8217;ll consider joining in.</p>
<p>Documentation :<br />
Online : <a href="http://docs.saltstack.com/" target="_blank">http://docs.saltstack.com/</a><br />
PDF : <a href="http://media.readthedocs.org/pdf/salt/latest/salt.pdf" target="_blank">http://media.readthedocs.org/pdf/salt/latest/salt.pdf</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2013/04/05/salt-stack-a-serious-alternative-to-puppet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See changes made to a filesystem with inotify</title>
		<link>http://blog.wains.be/2013/04/05/see-changes-made-to-a-filesystem-with-inotify/</link>
		<comments>http://blog.wains.be/2013/04/05/see-changes-made-to-a-filesystem-with-inotify/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 06:58:19 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1299</guid>
		<description><![CDATA[Install the package &#8220;inotify-tools&#8221; with your package manager (in EPEL for RHEL). Then create and execute this script : inotifywait -m -r --format $'%T %e %w%f' --timefmt '%H:%M:%S' --exclude ~/'(\.mozilla&#124;Documents/KeepNote)' -e modify -e move -e create -e delete ~ 2&#62;&#38;1 &#8230; <a href="http://blog.wains.be/2013/04/05/see-changes-made-to-a-filesystem-with-inotify/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Install the package &#8220;inotify-tools&#8221; with your package manager (in EPEL for RHEL).</p>
<p>Then create and execute this script :</p>
<pre>inotifywait -m -r --format $'%T %e %w%f' --timefmt '%H:%M:%S' --exclude ~/'(\.mozilla|Documents/KeepNote)' -e modify -e move -e create -e delete ~ 2&gt;&amp;1 | awk '/^[0-9]/ {
sub(/'"${HOME//\//\\/}"'/, "~", $0)
split($0, a, " ")
len=length(a[1])+length(a[2])+1
printf "%-20s %s\n", substr($0, 0, len), substr($0, len+2)
// flush stdout
system("")
next
}
{print ; system("")}
' | tee -a /tmp/home_monitor</pre>
<p>Source : http://blog.yjl.im/2010/11/monitoring-file-system-changes-with.html</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2013/04/05/see-changes-made-to-a-filesystem-with-inotify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rundeck howto and examples</title>
		<link>http://blog.wains.be/2012/12/03/rundeck-howto-and-examples/</link>
		<comments>http://blog.wains.be/2012/12/03/rundeck-howto-and-examples/#comments</comments>
		<pubDate>Mon, 03 Dec 2012 22:56:18 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1291</guid>
		<description><![CDATA[Quoting rundeck.org : Rundeck is an Open Source process automation and command orchestration tool with a web console. As I understand it, it&#8217;s a fork of Control Tier : www.controltier.org I&#8217;m usually all for the command-line, but you have to &#8230; <a href="http://blog.wains.be/2012/12/03/rundeck-howto-and-examples/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Quoting <a href="http://www.rundeck.org">rundeck.org</a> : Rundeck is an Open Source process automation and command orchestration tool with a web console. As I understand it, it&#8217;s a fork of Control Tier : <a href="http://www.controltier.org">www.controltier.org</a> I&#8217;m usually all for the command-line, but you have to admit the devs have done a pretty good job regarding the web console. The <a href="http://rundeck.org/docs/">documentation</a> is pretty good as well. No need to install agents on your servers. It works over SSH. You just need to deploy a dedicated public SSH key and you&#8217;re done (see ssh-copy-id). This post should help you install and configure Rundeck in under 15 minutes. It covers configuration of email, SSL, authentication against Active Directory and explains how you can store your node definitions from a URL. <strong>Installation on Red Hat :</strong> basically a single RPM with no deps. You just need a working java. OpenJDK is working fine. <strong>Email configuration (apparently not documented) : </strong>Edit /etc/rundeck/rundeck-config.properties</p>
<pre>grails.mail.host=smtp.example.org
grails.mail.port=25
grails.mail.default.from=rundeck@example.org</pre>
<p><strong>Enabling SSL on the web console (self-signed) :</strong> See <a href="http://rundeck.org/docs/administration/ssl.html ">http://rundeck.org/docs/administration/ssl.html </a>Basically :</p>
<pre>cd /etc/rundeck/ssl keytool -keystore keystore -alias rundeck -genkey -keyalg RSA -keypass password -storepass password
cp /etc/rundeck/ssl/keystore /etc/rundeck/ssl/truststore</pre>
<p>/etc/rundeck/framework.properties :</p>
<pre>framework.server.url = https://localhost:4443
framework.rundeck.url = https://localhost:4443
framework.server.port = 4443</pre>
<p>Under /etc/rundeck/profile uncomment :</p>
<pre>export RDECK_JVM="$RDECK_JVM -Drundeck.ssl.config=/etc/rundeck/ssl/ssl.properties -Dserver.https.port=4443"</pre>
<p><strong>Enabling LDAP against Active Directory for authentication :</strong>/etc/rundeck/profile :</p>
<pre>export RDECK_JVM="-Djava.security.auth.login.config=/etc/rundeck/jaas-ldap.conf \
    -Dloginmodule.name=ldap \
    -Drdeck.config=/etc/rundeck \
    -Drdeck.base=/etc/rundeck \
    -Drundeck.server.configDir=/etc/rundeck \
    -Dserver.datastore.path=/var/lib/rundeck/data \
    -Drundeck.server.serverDir=/var/lib/rundeck \
    -Drdeck.projects=/var/rundeck/projects \
    -Drdeck.runlogs=/var/lib/rundeck/logs \
    -Drundeck.config.name=/etc/rundeck/rundeck-config.properties \
    -Djava.io.tmpdir=$RUNDECK_TEMPDIR"</pre>
<p>/etc/rundeck/jaas-ldap.conf :</p>
<pre>ldap {
    com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule required
    debug="true"
    contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
    providerUrl="ldap://intranet.example.org:389"
    bindDn="cn=queryldapaccount,ou=tech,ou=company,dc=intranet,dc=example,dc=org"
    bindPassword="xxx"
    authenticationMethod="simple"
    forceBindingLogin="true"
    userBaseDn="ou=company,dc=intranet,dc=example,dc=org"
    userRdnAttribute="sAMAccountName"
    userIdAttribute="sAMAccountName"
    userPasswordAttribute="unicodePwd"
    userObjectClass="user"
    roleBaseDn="OU=groups,OU=company,DC=intranet,DC=example,DC=org"
    roleNameAttribute="cn"
    roleMemberAttribute="member"
    roleObjectClass="group"
    cacheDurationMillis="300000"
    reportStatistics="true";
};</pre>
<p><strong>Configuring authorization :</strong> You have the YAML file /etc/rundeck/admin.aclpolicy The following gives full access to Rundeck for members of <strong>rundeck_superadmin </strong>group, and limits execution of jobs under the group PRD/system for members of <strong>rundeck_admin</strong>. For &#8220;groups&#8221;, see LDAP configuration, under roleBaseDn.</p>
<pre>description: Super Admin, all access.
context:
  project: '.*' # all projects
for:
  resource:
    - allow: '*' # allow read/create all kinds
  adhoc:
    - allow: '*' # allow running/killing adhoc jobs
  job:
    - allow: '*' # allow read/write/delete/run/kill of all jobs
  node:
    - allow: '*' # allow read/run for all nodes
by:
  group: [rundeck_superadmin]

---

description: Super Admin, all access.
context:
  application: 'rundeck'
for:
  resource:
    - allow: '*' # allow create of projects
  project:
    - allow: '*' # allow view/admin of all projects
by:
  group: [rundeck_superadmin]

<strong></strong>---

description: Admin can run jobs under the PRD/system group.
context:
  project: '.*' # all projects
for:
  resource:
    - equals:
        kind: job
      allow: [read]
    - equals:
        kind: node
      allow: [read,create,update,refresh] 
    - equals:
        kind: event
      allow: [read,create] 
  adhoc:
    - allow: [read] 
  job:
    - equals:
        group: 'DEV'
      allow: [read]
    - equals:
        group: 'STAGING'
      allow: [read]
    - equals:
        group: 'PRD/cron'
      allow: [read]
    - equals:
        group: 'PRD/system'
      allow: [read, run, kill]
  node:
    - allow: [read,run] 
by:
  group: [rundeck_admin]
---
description: Admin Application level access control, applies to creating/deleting projects, admin of user profiles, viewing projects and reading system information.
context:
  application: 'rundeck'
for:
  resource:
    - equals:
        kind: project
      allow: [read]
    - equals:
        kind: system
      allow: [read] # allow read of system info
    - equals:
        kind: user
      allow: [read] # allow modify user profiles
  project:
    - match:
        name: '.*'
      allow: [read]
by:
  group: [rundeck_admin]</pre>
<div></div>
<div>You&#8217;ve deployed the SSH key and following those steps ? The web console is protected by HTTPS. You authenticate users against your Active Directory. You&#8217;re almost good to go.</div>
<div></div>
<div><strong>Node inventory</strong></div>
<div></div>
<div>You can either edit a XML file under your project folder : /var/rundeck/projects/EXAMPLE/etc/resources.xml</div>
<div></div>
<div>This is what the file should look like :</div>
<div>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!-- 20121203 17:41:12 --&gt;
&lt;project&gt;
&lt;node name="node1.intranet.example.org" type="Node"
description="Node description"
hostname="node1.intranet.example.org"
username="root"
osFamily="RHEL"
osVersion="6"
osArch="64"
tags="EXAMPLE, OWNER, STAGING, WWW, ROOM_BXL, RACK10, PDU10_02"
file-copy-destination-dir="/var/tmp/"
/&gt;
&lt;/project&gt;</pre>
</div>
<div>Regarding tags, imagination is your only limit. I personally specify the project manager name, room, role, if it&#8217;s either on or off and the environment. You can filter using a mix of fields (e.g. : please display RHEL5 64 bits staging server in room X, your query would look something like : tags:ROOM_X+STAGING and osVersion:5 and osArch:64).</div>
<div></div>
<div>So you can either save the XML file locally, or you can call it from a URL. That&#8217;s what I do by defining a URL Source under Resource Model Sources. I don&#8217;t have a CMDB yet, so I manually update a CSV, and wrote a bash script generating the XML and making it available in a SVN repository (don&#8217;t forget to set the MIME type application/xml to *.xml, see auto-props under your SVN configuration).</div>
<div></div>
<div><a href="http://blog.wains.be/wp-content/uploads/2012/12/Screen-Shot-2012-12-03-at-23.04.10.png"><img class="alignnone size-medium wp-image-1293" title="Rundeck project configuration" src="http://blog.wains.be/wp-content/uploads/2012/12/Screen-Shot-2012-12-03-at-23.04.10-206x300.png" alt="" width="206" height="300" /></a></div>
<div></div>
<div>Now, you&#8217;re really good to go. You can start sending ad-hoc commands to your servers, or start looking into jobs. Rundeck jobs have replaced local crons on my servers. I don&#8217;t store script on servers anymore. They are all stored in a SVN repository (they were already before Rundeck) and are called directly from Rundeck. I had to modify some of them,  look into &#8220;job options&#8221; as you don&#8217;t want to store sensitive information in your scripts, as they are copied in the /tmp directory before being executed. You can see in my node definition that I specify this :</div>
<div>
<pre>file-copy-destination-dir="/var/tmp/"</pre>
</div>
<div>By default, Rundeck will use /tmp but some of my servers have /tmp mounted as a partition with the noexec flag. This would produce an error in Rundeck.</div>
<div></div>
<div></div>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2012/12/03/rundeck-howto-and-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveMQ 5.4.x install under RHEL 5.x</title>
		<link>http://blog.wains.be/2012/01/06/activemq-5-4-x-install-under-rhel-5-x/</link>
		<comments>http://blog.wains.be/2012/01/06/activemq-5-4-x-install-under-rhel-5-x/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 18:03:41 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[ActiveMQ]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1286</guid>
		<description><![CDATA[Tested with ActiveMQ 5.4.3, Red Hat Linux Enterprise 5.7 64 bits with Sun JVM 1.5 ActiveMQ 5.5.x requires JVM 1.6 The following is a simple copy and paste howto. Simply adapt the install variables and you&#8217;re good to go. Let&#8217;s &#8230; <a href="http://blog.wains.be/2012/01/06/activemq-5-4-x-install-under-rhel-5-x/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>Tested with ActiveMQ 5.4.3, Red Hat Linux Enterprise 5.7 64 bits with Sun JVM 1.5</p>
<p>ActiveMQ 5.5.x requires JVM 1.6</em></p>
<p>The following is a simple copy and paste howto. Simply adapt the install variables and you&#8217;re good to go.</p>
<p><strong>Let&#8217;s declare some variables for the install process :</strong></p>
<p><code>AMQDIR="/usr/local"<br />
VERSION="5.4.3"</code></p>
<p><strong>Download and installation :</strong></p>
<p><code>cd /root<br />
wget http://apache.cu.be//activemq/apache-activemq/$VERSION/apache-activemq-$VERSION-bin.tar.gz<br />
cp /root/apache-activemq-$VERSION-bin.tar.gz $AMQDIR<br />
cd $AMQDIR<br />
tar xvzf apache-activemq-$VERSION-bin.tar.gz<br />
chown root. apache-activemq* -R<br />
ln -f -s apache-activemq-$VERSION activemq</code></p>
<p><strong>Configuration :</strong></p>
<p><code>sed -i 's#ACTIVEMQ_HOME.*#ACTIVEMQ_HOME="$AMQDIR/activemq"#g' $AMQDIR/activemq/bin/linux-x86-64/activemq</p>
<p>sed -i 's#set.default.ACTIVEMQ_HOME=.*#set.default.ACTIVEMQ_HOME=$AMQDIR/activemq#g' $AMQDIR/activemq/bin/linux-x86-64/wrapper.conf</p>
<p>sed -i 's#set.default.ACTIVEMQ_BASE=.*#set.default.ACTIVEMQ_BASE=$AMQDIR/activemq#g' $AMQDIR/activemq/bin/linux-x86-64/wrapper.conf</code></p>
<p><strong>Init script and making ActiveMQ start at boot :</strong></p>
<p><code>ln -s $AMQDIR/activemq/bin/linux-x86-64/activemq /etc/init.d/activemq<br />
chkconfig --add activemq<br />
chkconfig activemq on<br />
service activemq start</code></p>
<p><strong>Logs :</strong></p>
<p><code>tail -f /usr/local/activemq/data/wrapper.log</code></p>
<p><strong>Accessing the admin section :</strong></p>
<p>http://$SERVER:8161/admin/index.jsp</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2012/01/06/activemq-5-4-x-install-under-rhel-5-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two step authentication on SSH with Google Authenticator under Debian Sid</title>
		<link>http://blog.wains.be/2011/10/25/two-step-authentication-on-ssh-with-google-authenticator-under-debian-sid/</link>
		<comments>http://blog.wains.be/2011/10/25/two-step-authentication-on-ssh-with-google-authenticator-under-debian-sid/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 18:17:06 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1270</guid>
		<description><![CDATA[On a Debian Sid system, install the following : apt-get install libpam-google-authenticator Edit /etc/ssh/sshd_config and set : ChallengeResponseAuthentication yes Restart the service : service ssh restart Now run : google-authenticator Scan the barcode from the Google Authenticator app on your &#8230; <a href="http://blog.wains.be/2011/10/25/two-step-authentication-on-ssh-with-google-authenticator-under-debian-sid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>On a Debian Sid system, install the following :</p>
<p><code>apt-get install libpam-google-authenticator</code></p>
<p>Edit /etc/ssh/sshd_config and set :</p>
<p><code>ChallengeResponseAuthentication yes</code></p>
<p>Restart the service :</p>
<p><code>service ssh restart</code></p>
<p>Now run :</p>
<p><code>google-authenticator</code></p>
<p>Scan the barcode from the Google Authenticator app on your mobile device.</p>
<p>Edit /etc/pam.d/sshd and add at the very beginning of the file :</p>
<p><code>auth required pam_google_authenticator.so</code></p>
<p>Now test a SSH connection. You should be prompted by a cool &#8220;Verification code :&#8221;<br />
Then by the regular password prompt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/10/25/two-step-authentication-on-ssh-with-google-authenticator-under-debian-sid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Spin down external USB drive on Debian Squeeze</title>
		<link>http://blog.wains.be/2011/08/04/spin-down-external-usb-drive-on-debian-squeeze/</link>
		<comments>http://blog.wains.be/2011/08/04/spin-down-external-usb-drive-on-debian-squeeze/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 19:03:34 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Debian/Ubuntu]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1255</guid>
		<description><![CDATA[It seems like I have at least two options to spin down my external USB drive used for rsnapshot backups (Iomega 1TB). In the first place, I assumed it would spin down by itself by simply unmounting the volume, like &#8230; <a href="http://blog.wains.be/2011/08/04/spin-down-external-usb-drive-on-debian-squeeze/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It seems like I have at least two options to spin down my external USB drive used for <a title="rsnapshot" href="http://www.rsnapshot.org" target="_blank">rsnapshot</a> backups (Iomega 1TB). In the first place, I assumed it would spin down by itself by simply unmounting the volume, like on the Mac. But it doesn&#8217;t.</p>
<p>So I gave sdparm a try :</p>
<pre>sdparm --command=stop /dev/backupdrive</pre>
<p>It doesn&#8217;t work <img src='http://blog.wains.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I found a working solution at <a title="http://forums.debian.net/viewtopic.php?f=7&amp;t=60122" href="http://forums.debian.net/viewtopic.php?f=7&amp;t=60122" target="_blank">http://forums.debian.net/viewtopic.php?f=7&amp;t=60122</a></p>
<pre>sg_start --readonly --stop /dev/backupdrive</pre>
<p>sg_start is part of sg3-utils package.<br />
YMMV, I guess ?</p>
<p>Use the cmd_postexec option in rsnapshot to trigger the spin down.</p>
<p>Want the same device name for your external USB drive ? Check out <a title="http://blog.wains.be/2010/04/10/udev-always-the-same-device-name-for-your-usb-drives/" href="http://blog.wains.be/2010/04/10/udev-always-the-same-device-name-for-your-usb-drives/" target="_blank">http://blog.wains.be/2010/04/10/udev-always-the-same-device-name-for-your-usb-drives/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/08/04/spin-down-external-usb-drive-on-debian-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Large files uploading fail with Apache + PHP + APC</title>
		<link>http://blog.wains.be/2011/07/06/large-files-uploading-fail-with-apache-php-apc/</link>
		<comments>http://blog.wains.be/2011/07/06/large-files-uploading-fail-with-apache-php-apc/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 09:15:38 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1232</guid>
		<description><![CDATA[We had one quite interesting problem at work. We had a Drupal site where we couldn&#8217;t upload files larger than 32 MB, while having in php.ini : upload_max_filesize = 200 MB post_max_size = 200M After disabling APC, we could upload &#8230; <a href="http://blog.wains.be/2011/07/06/large-files-uploading-fail-with-apache-php-apc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>We had one quite interesting problem at work.</p>
<p>We had a Drupal site where we couldn&#8217;t upload files larger than 32 MB, while having in php.ini :</p>
<p><code>upload_max_filesize = 200 MB<br />
post_max_size = 200M</code></p>
<p>After disabling APC, we could upload larger files.</p>
<p>It turns out, it seems changing the following in apc.ini</p>
<p><code>apc.rfc1867_freq=0</code></p>
<p>to </p>
<p><code>apc.rfc1867_freq=100k</code></p>
<p>fixed the problem.</p>
<p>Doc : <a href="http://www.php.net/manual/en/apc.configuration.php#ini.apc.rfc1867-freq">http://www.php.net/manual/en/apc.configuration.php#ini.apc.rfc1867-freq</a></p>
<pre><code>apc.rfc1867_freq string

The frequency that updates should be made to the user cache entry for upload progress. This can take the form of a percentage of the total file size or a size in bytes optionally suffixed with "k", "m", or "g" for kilobytes, megabytes, or gigabytes respectively (case insensitive). A setting of 0 updates as often as possible, which may cause slower uploads.</code></pre>
<p>I&#8217;m pretty sure this should not be related, as I have apc.rfc1867=0 in apc.ini. </p>
<p>If someone has a clue, drop me a line <img src='http://blog.wains.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/07/06/large-files-uploading-fail-with-apache-php-apc/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Authenticate Linux Red Hat with Microsoft Active Directory</title>
		<link>http://blog.wains.be/2011/04/11/authenticate-linux-red-hat-with-microsoft-active-directory/</link>
		<comments>http://blog.wains.be/2011/04/11/authenticate-linux-red-hat-with-microsoft-active-directory/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 21:05:45 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat/CentOS]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1201</guid>
		<description><![CDATA[Tested with Active Directory 2003 and RHEL 6.0 What we want to do : - authentication against AD using Winbind and Kerberos - allowing local and remote (SSH) authentication to members of a specific AD group (linuxadmin) - allowing members &#8230; <a href="http://blog.wains.be/2011/04/11/authenticate-linux-red-hat-with-microsoft-active-directory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>Tested with Active Directory 2003 and RHEL 6.0</em></p>
<p><strong>What we want to do :</strong></p>
<p>- authentication against AD using Winbind and Kerberos<br />
- allowing local and remote (SSH) authentication to members of a specific AD group (linuxadmin)<br />
- allowing members of linuxadmin to use sudo<br />
- UID/GID mapping against AD<br />
- user homedir will be created at first log using pam_mkhomedir<br />
- still possible to log in using local accounts, in case AD is unavailable</p>
<p><strong>Check if resolution works :</strong></p>
<p><code># host -t srv _kerberos._tcp.intranet.example.org<br />
_kerberos._tcp.intranet.example.org has SRV record 0 100 88 ad01.intranet.example.org.<br />
_kerberos._tcp.intranet.example.org has SRV record 0 100 88 ad02.intranet.example.org.<br />
_kerberos._tcp.intranet.example.org has SRV record 0 100 88 ad03.intranet.example.org.</code></p>
<p><strong>Install necessary packages and enable Winbind at boot :</strong></p>
<p><code># yum install samba-common pam_krb5 sudo authconfig<br />
# chkconfig winbind on</code></p>
<p><strong>Create directory where homedirs will be stored :</strong></p>
<p><code># mkdir /home/EXAMPLE<br />
# chmod 0777 /home/EXAMPLE</code></p>
<p>IMPORTANT : before proceeding, we need to make sure &#8220;hostname -f&#8221; returns a FQDN, <strong>THE SUBDOMAIN MUST MATCH THE AD DOMAIN</strong>.</p>
<p><code># hostname -f<br />
srv.intranet.example.org</code></p>
<p><strong>Enable authentication :</strong></p>
<p><code># authconfig<br />
  --disablecache<br />
  --enablewinbind<br />
  --enablewinbindauth<br />
  --smbsecurity=ads<br />
  --smbworkgroup=EXAMPLE<br />
  --smbrealm=INTRANET.EXAMPLE.ORG<br />
  --enablewinbindusedefaultdomain<br />
  --winbindtemplatehomedir=/home/EXAMPLE/%U<br />
  --winbindtemplateshell=/bin/bash<br />
  --enablekrb5<br />
  --krb5realm=INTRANET.EXAMPLE.ORG<br />
  --enablekrb5kdcdns<br />
  --enablekrb5realmdns<br />
  --enablelocauthorize<br />
  --enablemkhomedir<br />
  --enablepamaccess<br />
  --updateall</code></p>
<p><strong>Under RHEL 5.0, authconfig didn&#8217;t have the enablemkhomedir and enablepamaccess options. (you&#8217;ll get &#8220;authconfig: error: no such option: &#8211;enablemkhomedir&#8221;)</strong></p>
<p>Winbind should restart by itself, if not :</p>
<p><code># service winbind restart</code></p>
<p>authconfig will modify a couple of files : /etc/samba/smb.conf, /etc/pam.d/system-auth, /etc/nsswitch.conf, etc.</p>
<p>By default, UID/GID will be stored locally, and will differ from one system to another.</p>
<p><strong>In order to always get the same UID/GID for our AD users/groups, we&#8217;ll map the ID&#8217;s against AD, by modifying /etc/samba/smb.conf :</strong></p>
<p>From :</p>
<p><code>   workgroup = EXAMPLE<br />
   realm = INTRANET.EXAMPLE.ORG<br />
   security = ads<br />
   idmap uid = 16777216-33554431<br />
   idmap gid = 16777216-33554431<br />
   template homedir = /home/EXAMPLE/%U<br />
   template shell = /bin/bash<br />
   winbind use default domain = true<br />
   winbind offline logon = false</code></p>
<p>To :</p>
<p><code>   workgroup = EXAMPLE<br />
   realm = INTRANET.EXAMPLE.ORG<br />
   security = ads<br />
<strong>   idmap domains = EXAMPLE<br />
   idmap config EXAMPLE:backend      = rid<br />
   idmap config EXAMPLE:base_rid     = 500<br />
   idmap config EXAMPLE:range        = 500-1000000<br />
   #idmap uid = 16777216-33554431<br />
   #idmap gid = 16777216-33554431</strong><br />
   template homedir = /home/EXAMPLE/%U<br />
   template shell = /bin/bash<br />
   winbind use default domain = true<br />
   winbind offline logon = false</code></p>
<p><strong>Now, in order to only allow members of linuxadmin group, edit :</strong></p>
<p>For RHEL5.6 : /etc/pam.d/system-auth<br />
For RHEL6.0 : /etc/pam.d/password-auth</p>
<p>I&#8217;ll also change the default homedir creation umask.</p>
<pre><code>#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
<strong>auth        requisite     pam_succeed_if.so user ingroup linuxadmin debug</strong>
auth        requisite     pam_succeed_if.so uid &gt;= 500 quiet
auth        sufficient    pam_krb5.so use_first_pass
auth        sufficient    pam_winbind.so use_first_pass
auth        required      pam_deny.so

account     required      pam_access.so
account     required      pam_unix.so broken_shadow
account     sufficient    pam_localuser.so
account     sufficient    pam_succeed_if.so uid &lt; 500 quiet
account     [default=bad success=ok user_unknown=ignore] pam_krb5.so
account     [default=bad success=ok user_unknown=ignore] pam_winbind.so
account     required      pam_permit.so

password    requisite     pam_cracklib.so try_first_pass retry=3 type=
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    sufficient    pam_krb5.so use_authtok
password    sufficient    pam_winbind.so use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     optional      pam_mkhomedir.so <strong>umask=0077</strong>
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session     optional      pam_krb5.so</code></pre>
<p><strong>Restart Winbind :</strong></p>
<p><code># service winbind restart</code></p>
<p><strong>Now, join the machine to the domain, in this example user01 has domain admin permissions.</strong></p>
<p><code># net ads join -U user01<br />
user01's password:<br />
Using short domain name -- example<br />
Joined 'SRV' to realm 'INTRANET.EXAMPLE.ORG'</code></p>
<p>When joining the domain, you could get error about DNS updates (maybe because the record already exists). This is not a problem.</p>
<p><strong>Restart Winbind again :</strong></p>
<p><code># service winbind restart</code></p>
<p><strong>Check if it works, by listing AD groups :</strong></p>
<p><code># wbinfo -g</code></p>
<p><strong>Now, allow users in the linuxadmin group to use sudo :</strong></p>
<p><code># echo "%linuxadmin ALL=(ALL) ALL" &gt;&gt; /etc/sudoers</code></p>
<p><strong>Test authentication using an AD account (in the linuxadmin group) and access to root account :</strong></p>
<p>On the server check the logs :<br />
<code>tail -f /var/log/secure</code></p>
<p>On the client :<br />
<code>$ ssh user01@srv.intranet.example.org<br />
user01@srv.intranet.example.org's password:<br />
Creating directory '/home/EXAMPLE/user01'.<br />
[user01@srv ~]$ sudo su -<br />
[sudo] password for user01:<br />
[root@srv ~]# </code></p>
<p>Test with another account, not being part of linuxadmin group, this time. User should be disconnected.</p>
<p>Logs should look something like this :</p>
<pre><code>Apr 17 17:15:52 x sshd[27114]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.1.1  user=user-01
Apr 17 17:15:52 x sshd[27114]: pam_krb5[27114]: authentication succeeds for 'user-01' (user-01@INTRANET.EXAMPLE.ORG)
Apr 17 17:15:52 x sshd[27114]: pam_winbind(sshd:account): [pamh: 0x7f6910199390] ENTER: pam_sm_acct_mgmt (flags: 0x0000)
Apr 17 17:15:52 x sshd[27114]: pam_winbind(sshd:account): user 'user-01' granted access
Apr 17 17:15:52 x sshd[27114]: pam_winbind(sshd:account): [pamh: 0x7f6910199390] LEAVE: pam_sm_acct_mgmt returning 0 (PAM_SUCCESS)
Apr 17 17:15:52 x sshd[27114]: pam_succeed_if(sshd:account): requirement "user ingroup linuxadmin" was met by user "user-01"
Apr 17 17:15:52 x sshd[27114]: Accepted password for user-01 from 192.168.1.1 port 59369 ssh2
Apr 17 17:15:53 x sshd[27114]: pam_unix(sshd:session): session opened for user user-01 by (uid=0)</code></pre>
<p><strong>Useful commands :</strong></p>
<pre><code># wbinfo -n user05
S-1-5-21-x-x-x-1129 User (1)

# getent passwd user05
user05:*:1129:519:John Doe:/home/example/user05:/bin/bash

# getent group linuxadmin
linuxadmin:*:7579:user01,user02,user03,user04

# wbinfo -u
# wbinfo -g

# wbinfo -D EXAMPLE
Name              : EXAMPLE
Alt_Name          : intranet.example.org
SID               : S-1-5-21-x-x-x
Active Directory  : Yes
Native            : Yes
Primary           : Yes
Sequence          : -1</code></pre>
<p><strong>Sources :</strong><br />
<a href="http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html">http://lanestechblog.blogspot.com/2010/11/ad-authentication-with-rhel-6.html</a><br />
<a href="http://conigliaro.org/2008/12/19/active-directory-authentication-with-winbind-on-red-hat-linux/">http://conigliaro.org/2008/12/19/active-directory-authentication-with-winbind-on-red-hat-linux/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/04/11/authenticate-linux-red-hat-with-microsoft-active-directory/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Importing certificates on Android (CA and client)</title>
		<link>http://blog.wains.be/2011/03/13/importing-certificates-on-android-ca-and-client/</link>
		<comments>http://blog.wains.be/2011/03/13/importing-certificates-on-android-ca-and-client/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 02:51:08 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1162</guid>
		<description><![CDATA[Tested on my HTC Hero running Android 2.2.1 They do not make it terribly obvious, so I believe this is worth a post. Android will not import CA cert in the PEM format, you&#8217;ll get a &#8220;no certificate to install&#8221; &#8230; <a href="http://blog.wains.be/2011/03/13/importing-certificates-on-android-ca-and-client/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><em>Tested on my HTC Hero running Android 2.2.1</em></p>
<p>They do not make it terribly obvious, so I believe this is worth a post.</p>
<p>Android will not import CA cert in the PEM format, you&#8217;ll get a &#8220;no certificate to install&#8221; message at some point.</p>
<p>You actually have to export a P12 certificate containing the client certificate and the CA.</p>
<p>Use this command :<br />
<code>openssl pkcs12 -export -in clientcert.pem -inkey clientcert.key -certfile cacert.pem -name "VPN" -out clientcert.p12</code></p>
<p>Drop the resulting file (clientcert.p12) at the root of your sdcard.</p>
<p>Go under Settings &gt; Location &amp; Security &gt; Install from SD card (under the section &#8220;Credential storage&#8221;).</p>
<p>After a few questions, you&#8217;re ready to go and you can proceed with the configuration of your Wi-Fi or VPN client (in my case WPA Enterprise Wi-Fi and OpenVPN).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/03/13/importing-certificates-on-android-ca-and-client/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Red Hat Cluster : VMware ESX fencing</title>
		<link>http://blog.wains.be/2011/02/17/red-hat-cluster-vmware-esx-fencing/</link>
		<comments>http://blog.wains.be/2011/02/17/red-hat-cluster-vmware-esx-fencing/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 22:08:53 +0000</pubDate>
		<dc:creator>Sébastien</dc:creator>
				<category><![CDATA[High-Availability]]></category>
		<category><![CDATA[Red Hat/CentOS]]></category>

		<guid isPermaLink="false">http://blog.wains.be/?p=1124</guid>
		<description><![CDATA[Tested on Red Hat Enterprise Linux 5.6 64 bits and VMware ESX 3.5 Edit November 2011 : Tested on RHEL6.1 and VMware ESX 4.1 If you set up a cluster, in case of failure, you&#8217;ll probably want the surviving host &#8230; <a href="http://blog.wains.be/2011/02/17/red-hat-cluster-vmware-esx-fencing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Tested on Red Hat Enterprise Linux 5.6 64 bits and VMware ESX 3.5<br />
Edit November 2011 : Tested on RHEL6.1 and VMware ESX 4.1</p>
<p>If you set up a cluster, in case of failure, you&#8217;ll probably want the surviving host to be able to &#8220;fence&#8221; or &#8220;<a href="http://en.wikipedia.org/wiki/STONITH">stonith</a>&#8221; the faulty node.</p>
<p>Red Hat Cluster provides a collection of scripts for that purpose (for APC, ILO, DRAC, etc. and VMware).</p>
<p>The vmware script doesn&#8217;t work out of the box :</p>
<pre><code># fence_vmware -a "esx.intranet.example.org" -l "fence_vmware_account" -p "xxx" -n 'node01'
fence_vmware_helper returned Please install VI Perl API package to use this tool!
Perl error: Can't locate VMware/VIRuntime.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 1) line 1.
BEGIN failed--compilation aborted at (eval 1) line 1.

Please use '-h' for usage</code></pre>
<p>Go to <a href="http://www.vmware.com/support/developer/viperltoolkit/">http://www.vmware.com/support/developer/viperltoolkit/</a> (you&#8217;ll need to register)</p>
<p>Grab either one of those : </p>
<p>ESX 3.5</p>
<p>VMware-VIPerl-1.6.0-104313.i386.tar.gz<br />
VMware-VIPerl-1.6.0-104313.x86_64.tar.gz</p>
<p>ESX 4.1</p>
<p>VMware-vSphere-Perl-SDK-4.1.0-*.i386.tar.gz<br />
VMware-vSphere-Perl-SDK-4.1.0-*.x86_64.tar.gz</p>
<p>You&#8217;ll need to install some stuff on your system :</p>
<p><strong>RHEL5</strong></p>
<pre><code># yum install openssl-devel

Dependencies Resolved

========================================================================================================================================================================
 Package                                   Arch                         Version                                 Repository                                         Size
========================================================================================================================================================================
Installing:
 openssl-devel                             i386                         0.9.8e-12.el5_5.7                       rhel-5Server-x86_64-updates                       1.9 M
 openssl-devel                             x86_64                       0.9.8e-12.el5_5.7                       rhel-5Server-x86_64-updates                       1.9 M
Installing for dependencies:
 e2fsprogs-devel                           x86_64                       1.39-23.el5_5.1                         rhel-5Server-x86_64-updates                       633 k
 keyutils-libs-devel                       x86_64                       1.2-1.el5                               rhel-5Server-x86_64-updates                        27 k
 krb5-devel                                x86_64                       1.6.1-55.el5                            rhel-5Server-x86_64-updates                       1.9 M
 libselinux-devel                          x86_64                       1.33.4-5.7.el5                          rhel-5Server-x86_64-updates                       149 k
 libsepol-devel                            x86_64                       1.15.2-3.el5                            rhel-5Server-x86_64-updates                       192 k
 zlib-devel                                x86_64                       1.2.3-3                                 rhel-5Server-x86_64-updates                       102 k

Transaction Summary
========================================================================================================================================================================
Install       8 Package(s)
Upgrade       0 Package(s)

Total download size: 6.7 M
Is this ok [y/N]: </code></pre>
<p><strong>RHEL6</strong></p>
<pre><code># yum install openssl-devel perl-Compress-Raw-Zlib perl-Compress-Zlib
Setting up Install Process
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package openssl-devel.x86_64 0:1.0.0-10.el6_1.5 will be installed
--&gt; Processing Dependency: pkgconfig for package: openssl-devel-1.0.0-10.el6_1.5.x86_64
--&gt; Processing Dependency: zlib-devel for package: openssl-devel-1.0.0-10.el6_1.5.x86_64
--&gt; Processing Dependency: krb5-devel for package: openssl-devel-1.0.0-10.el6_1.5.x86_64
--&gt; Processing Dependency: /usr/bin/pkg-config for package: openssl-devel-1.0.0-10.el6_1.5.x86_64
---&gt; Package perl-Compress-Raw-Zlib.x86_64 0:2.023-119.el6_1.1 will be installed
---&gt; Package perl-Compress-Zlib.x86_64 0:2.020-119.el6_1.1 will be installed
--&gt; Processing Dependency: perl(IO::Uncompress::Gunzip) &gt;= 2.020 for package: perl-Compress-Zlib-2.020-119.el6_1.1.x86_64
--&gt; Processing Dependency: perl(IO::Compress::Gzip) &gt;= 2.020 for package: perl-Compress-Zlib-2.020-119.el6_1.1.x86_64
--&gt; Processing Dependency: perl(IO::Compress::Gzip::Constants) &gt;= 2.020 for package: perl-Compress-Zlib-2.020-119.el6_1.1.x86_64
--&gt; Processing Dependency: perl(IO::Compress::Base::Common) &gt;= 2.020 for package: perl-Compress-Zlib-2.020-119.el6_1.1.x86_64
--&gt; Running transaction check
---&gt; Package krb5-devel.x86_64 0:1.9-9.el6_1.2 will be installed
--&gt; Processing Dependency: libselinux-devel for package: krb5-devel-1.9-9.el6_1.2.x86_64
--&gt; Processing Dependency: libcom_err-devel for package: krb5-devel-1.9-9.el6_1.2.x86_64
--&gt; Processing Dependency: keyutils-libs-devel for package: krb5-devel-1.9-9.el6_1.2.x86_64
---&gt; Package perl-IO-Compress-Base.x86_64 0:2.020-119.el6_1.1 will be installed
---&gt; Package perl-IO-Compress-Zlib.x86_64 0:2.020-119.el6_1.1 will be installed
---&gt; Package pkgconfig.x86_64 1:0.23-9.1.el6 will be installed
---&gt; Package zlib-devel.x86_64 0:1.2.3-25.el6 will be installed
--&gt; Running transaction check
---&gt; Package keyutils-libs-devel.x86_64 0:1.4-1.el6 will be installed
---&gt; Package libcom_err-devel.x86_64 0:1.41.12-7.el6 will be installed
---&gt; Package libselinux-devel.x86_64 0:2.0.94-5.el6 will be installed
--&gt; Processing Dependency: libsepol-devel &gt;= 2.0.32-1 for package: libselinux-devel-2.0.94-5.el6.x86_64
--&gt; Processing Dependency: pkgconfig(libsepol) for package: libselinux-devel-2.0.94-5.el6.x86_64
--&gt; Running transaction check
---&gt; Package libsepol-devel.x86_64 0:2.0.41-3.el6 will be installed
--&gt; Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================
 Package                              Arch                 Version                           Repository                                 Size
=============================================================================================================================================
Installing:
 openssl-devel                        x86_64               1.0.0-10.el6_1.5                  rhel-6Server-x86_64-updates               1.1 M
 perl-Compress-Raw-Zlib               x86_64               2.023-119.el6_1.1                 rhel-6Server-x86_64-updates                67 k
 perl-Compress-Zlib                   x86_64               2.020-119.el6_1.1                 rhel-6Server-x86_64-updates                43 k
Installing for dependencies:
 keyutils-libs-devel                  x86_64               1.4-1.el6                         rhel-6Server-x86_64-updates                28 k
 krb5-devel                           x86_64               1.9-9.el6_1.2                     rhel-6Server-x86_64-updates               1.2 M
 libcom_err-devel                     x86_64               1.41.12-7.el6                     rhel-6Server-x86_64-updates                30 k
 libselinux-devel                     x86_64               2.0.94-5.el6                      rhel-6Server-x86_64-updates               135 k
 libsepol-devel                       x86_64               2.0.41-3.el6                      rhel-6Server-x86_64-updates                64 k
 perl-IO-Compress-Base                x86_64               2.020-119.el6_1.1                 rhel-6Server-x86_64-updates                66 k
 perl-IO-Compress-Zlib                x86_64               2.020-119.el6_1.1                 rhel-6Server-x86_64-updates               133 k
 pkgconfig                            x86_64               1:0.23-9.1.el6                    rhel-6Server-x86_64-updates                70 k
 zlib-devel                           x86_64               1.2.3-25.el6                      rhel-6Server-x86_64-updates                43 k

Transaction Summary
=============================================================================================================================================
Install      12 Package(s)

Total download size: 3.0 M
Installed size: 6.4 M
Is this ok [y/N]: </code></pre>
<p>Unzip VMware-*.tar.gz and run :<br />
<code>./vmware-install.pl</code></p>
<p>Accept the terms. (yes, this is needed).</p>
<p>Then you should get to this :</p>
<p><code>The installation of VMware VIPerl Toolkit 1.6.0 build-104313 for Linux<br />
completed successfully. You can decide to remove this software from your system<br />
at any time by invoking the following command:<br />
"/usr/bin/vmware-uninstall-viperl.pl".</code></p>
<p>Make sure you add &#8220;virtual machine administrator&#8221; permissions to &#8220;vmware_fence_account&#8221;, for the VM&#8217;s it needs to stonith.</p>
<p>From now on, you should be able to stonith VM&#8217;s.</p>
<p>Here&#8217;s a working RHCS config (/etc/cluster/cluster.conf) :</p>
<p>[sourcecode language="xml"]<br />
&lt;?xml version=&quot;1.0&quot;?&gt;<br />
&lt;cluster alias=&quot;ServiceClusterTEST&quot; config_version=&quot;4&quot; name=&quot;ServiceTEST&quot;&gt;<br />
&lt;totem token=&quot;45000&quot;/&gt;<br />
&lt;fence_daemon post_fail_delay=&quot;0&quot; post_join_delay=&quot;3&quot;/&gt; &lt;fence_daemon clean_start=&quot;1&quot;/&gt;<br />
&lt;clusternodes&gt;<br />
&lt;clusternode name=&quot;node01.intranet.example.org&quot; nodeid=&quot;1&quot; votes=&quot;1&quot;&gt;<br />
&lt;fence&gt;<br />
&lt;method name=&quot;1&quot;&gt;<br />
&lt;device name=&quot;node01&quot;/&gt;<br />
&lt;/method&gt;<br />
&lt;/fence&gt;<br />
&lt;/clusternode&gt;<br />
&lt;clusternode name=&quot;node02.intranet.example.org&quot; nodeid=&quot;2&quot; votes=&quot;1&quot;&gt;<br />
&lt;fence&gt;<br />
&lt;method name=&quot;1&quot;&gt;<br />
&lt;device name=&quot;node02&quot;/&gt;<br />
&lt;/method&gt;<br />
&lt;/fence&gt;<br />
&lt;/clusternode&gt;<br />
&lt;/clusternodes&gt;<br />
&lt;cman expected_votes=&quot;1&quot; two_node=&quot;1&quot;/&gt;<br />
&lt;fencedevices&gt;<br />
&lt;fencedevice agent=&quot;fence_vmware&quot; ipaddr=&quot;esx.intranet.example.org&quot; login=&quot;vmware_fence_account&quot; passwd=&quot;password&quot; name=&quot;node01&quot; port=&quot;node01&quot;/&gt;<br />
&lt;fencedevice agent=&quot;fence_vmware&quot; ipaddr=&quot;esx.intranet.example.org&quot; login=&quot;vmware_fence_account&quot; passwd=&quot;password&quot; name=&quot;node02&quot; port=&quot;node02&quot;/&gt;<br />
&lt;/fencedevices&gt;<br />
&lt;rm&gt;<br />
&lt;resources&gt;<br />
[whatever resources you have]<br />
&lt;/resources&gt;<br />
&lt;service name=&quot;Service&quot; autostart=&quot;1&quot;&gt;<br />
[whatever services the cluster is in charge of]<br />
&lt;/service&gt;<br />
&lt;/rm&gt;<br />
&lt;/cluster&gt;<br />
[/sourcecode]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.wains.be/2011/02/17/red-hat-cluster-vmware-esx-fencing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
