<?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>techslaves.org &#187; software</title>
	<atom:link href="http://techslaves.org/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://techslaves.org</link>
	<description>Owned (and fascinated) by technology!</description>
	<lastBuildDate>Wed, 16 Nov 2011 03:36:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FreeIPA and Samba 3 Integration</title>
		<link>http://techslaves.org/2011/08/24/freeipa-and-samba-3-integration/</link>
		<comments>http://techslaves.org/2011/08/24/freeipa-and-samba-3-integration/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 05:06:28 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[freeipa]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=169</guid>
		<description><![CDATA[FreeIPA makes a pretty excellent backend for Samba 3. While all the information one needs to set this up is available online, I wasn&#8217;t able to find it all  in one location so I&#8217;ve decided to try my best at filling that gap here on techslaves.org. Hopefully this short guide will aid those trying to piece [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/05/ldap-user-management-tools-and-user-private-groups/' rel='bookmark' title='LDAP User Management Tools and User Private Groups'>LDAP User Management Tools and User Private Groups</a></li>
<li><a href='http://techslaves.org/2010/08/04/life-support/' rel='bookmark' title='Life Support!'>Life Support!</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>FreeIPA makes a pretty excellent backend for Samba 3. While all the information one needs to set this up is available online, I wasn&#8217;t able to find it all  in one location so I&#8217;ve decided to try my best at filling that gap here on techslaves.org. Hopefully this short guide will aid those trying to piece together the various parts necessary to integrate FreeIPA v2 and Samba 3, at least until FreeIPA v3 where there is talk of enabling Samba integration with a simple command line argument to the &#8220;ipa-server-install&#8221; script.</p>
<h1>Not for Domains</h1>
<p>It&#8217;s important to keep in mind that these instructions are not for a integrating FreeIPA with a Samba domain controller but merely a Samba file server. My understanding is that FreeIPA will never conveniently/properly support the necessary bits to make it a suitable backend for a Samba 3 PDC. I believe FreeIPA will eventually look towards Samba 4 integration (using Domain trusts) for this kind of integration but don&#8217;t quote me on that. Either way, these instructions are not for Samba domain controllers, just Samba file servers.</p>
<h1>The Assumptions</h1>
<p>There are some basic assumptions that these instructions make.</p>
<ul>
<li>FreeIPA is installed and functional</li>
<li>You have a general idea of how to use LDAP command line tools</li>
<li>If you have a nice GUI LDAP browser, you can use it to apply the example LDIFs and edit the tree instead of the ldap CLI tools</li>
<li>The LDAP commands are executed on the FreeIPA server</li>
<li>Samba and FreeIPA are installed on the same server (although it shouldn&#8217;t be difficult to use TLS encryption with separate servers)</li>
<li>Your LDAP suffix is <em>&#8220;dc=domain,dc=tld&#8221;</em></li>
<li>You know the difference between the &#8220;admin&#8221; account and the directory manager and their passwords</li>
</ul>
<h1>The Goods</h1>
<p>Let&#8217;s not beat around the bush any further.</p>
<p>1. Determine your Samba server SID by executing the following command while <em>smbd</em> is running and jot it down:</p>
<pre>root@ipaserver:~
# net getlocalsid
SID for IPASERVER domain  is: S-1-5-21-3180075094-3458813485-3821849995</pre>
<p>2. With the &#8220;admin&#8221; kerberos ticket, add two attributes to &#8220;<em>cn=ipaConfig,dc=etc,dc=domain,dc=tld&#8221;</em> that tell FreeIPA to setup each account as a Samba account and each group as a Samba group:</p>
<pre>ldapmodify -Y GSSAPI &lt;&lt;EOF
dn: cn=ipaconfig,cn=etc,dc=domain,dc=tld
changetype: modify
add: ipaUserObjectClasses
ipaUserObjectClasses: sambaSAMAccount
-
add: ipaGroupObjectClasses
ipaGroupObjectClasses: sambaGroupMapping
EOF</pre>
<p>3. With the directory manager password and the Samba SID you jotted down from above, create an instance of the 389 DS DNA plugin that will automatically generate SIDs for your users and groups which are necessary for use with Samba:</p>
<pre>ldapadd -x -D "cn=Directory Manager" -W &lt;&lt;EOF
dn: cn=SambaGroupSid,cn=Distributed Numeric Assignment Plugin,cn=plugins,cn=config
objectClass: top
objectClass: extensibleObject
dnatype: sambaSID
dnaprefix: S-1-5-21-3180075094-3458813485-3821849995-
dnainterval: 1
dnamagicregen: assign
dnafilter: (|(objectclass=sambasamaccount)(objectclass=sambagroupmapping))
dnascope: dc=domain,dc=tld
cn: SambaSid
dnanextvalue: 15277
EOF</pre>
<p>The thing to note here is that the <em>&#8220;dnaprefix&#8221;</em> is set to the SID your jotted down… <em>PLUS</em> a hyphen (&#8220;-&#8221;) appended to the end!</p>
<p>4. Now we have to start modifying the FreeIPA API, CLI and WebUI to allow us to specify the <em>&#8220;sambaGroupType&#8221;</em> attribute at group creation time. We have to set <em>&#8220;sambaGroupType&#8221;</em> because it is a required attribute for the objectClass <em>&#8220;sambaGroupMapping&#8221;</em> which we are automatically adding to every group with the <em>&#8220;ipaGroupObjectClasses&#8221;</em> setting from earlier.</p>
<p>Although the value is going to be &#8220;4&#8243; for every conceivable case in this non-domain configuration, I was not able to figure out how to make the DNA plugin insert static values like it can set incrementing values so I decided to allow setting it through the CLI and WebUS with defaults enabled instead. If anyone knows how to setup 389 to automatically add an attribute with a static value upon DN creation of DNs with specific objectClasses, please tell me.</p>
<p>There are a few steps required to make this CLI/UI stuff happen but the FreeIPA developers have actually made this quite simple.</p>
<p>The rule is: Extend the FreeIPA schema first, then the CLI, then the WebUI.</p>
<p>4.1. Extend the FreeIPA schema with a custom field by adding the attribute <em>&#8220;ipaCustomFields&#8221;</em> with a value of <em>&#8220;Samba Group Type,sambagrouptype,true&#8221;</em> to <em>&#8220;cn=ipaConfig,dc=etc,dc=domain,dc=tld&#8221;</em> with an &#8220;admin&#8221; kerberos ticket:</p>
<pre>ldapmodify -Y GSSAPI &lt;&lt;EOF
dn: cn=ipaconfig,cn=etc,dc=domain,dc=tld
changetype: add
add: ipaCustomFields
ipaCustomFields: "Samba Group Type,sambagrouptype,true"
EOF</pre>
<p>As there can only be one <em>&#8220;ipaCustomFields&#8221;</em> attribute, if you have multiple custom fields you need to separate each definition with a &#8220;$&#8221; like so: <em>&#8220;Samba Group Type,sambagrouptype,true$Description,attrname,isrequiredboolean&#8221;</em>.</p>
<p>4.2. Extend the CLI for groups by editing the python file &#8220;/&#8230;/site-packages/ipalib/plugins/group.py&#8221; to define the custom field and specify a default if not implicitly defined (diff):</p>
<pre>--- group.py.orig	2011-08-15 14:59:48.570715207 -0700
+++ group.py	2011-08-16 12:43:43.493236507 -0700
@@ -118,6 +118,13 @@
             label=_('GID'),
             doc=_('GID (use this option to set it manually)'),
         ),
+        Int('sambagrouptype',
+            cli_name='sgt',
+            label=_('Samba Group Type'),
+            doc=_('Samba Group Type (default is 4)'),
+            default=4,
+            autofill=True,
+        ),
     )

 api.register(group)</pre>
<p><strong>Important</strong>: Restart &#8220;httpd&#8221; at this point!</p>
<p>4.3. Test the CLI. With an &#8220;admin&#8221; (or equivalent priv) kerberos ticket, try creating a new group:</p>
<pre>account@ipaserver:~
$ ipa group-add testgrp --desc="Testing the group.py CLI mods"
---------------------
Added group "testgrp"
---------------------
  Group name: testgrp
  Description: Testing the group.py CLI mods
  GID: 1234500010
  Samba Group Type: 4</pre>
<p>4.4 With the CLI functioning properly, we can move on to extending the WebUI. To extend the WebUI for group attributes, edit &#8220;/usr/share/ipa/ui/group.js&#8221; like so (diff):</p>
<pre>--- group.js.orig	2011-08-15 10:01:28.515209121 -0700
+++ group.js	2011-08-16 13:52:59.587352034 -0700
@@ -34,6 +34,7 @@
                 column({name: 'cn'}).
                 column({name: 'gidnumber'}).
                 column({name: 'description'}).
+                column({name: 'sambagrouptype'}).
                 dialog(
                     IPA.add_dialog({
                         'name': 'add',
@@ -41,6 +42,7 @@
                     }).
                         field(IPA.text_widget({name: 'cn', undo: false})).
                         field(IPA.text_widget({name: 'description', undo: false})).
+                        field(IPA.select_widget({name: 'sambagrouptype', undo: false, options: [{label: 'Local', value: 4}, {label: 'Domain', value: 2}]})).
                         field(IPA.checkbox_widget({
                             name: 'posix',
                             label: IPA.messages.objects.group.posix,
@@ -56,6 +58,7 @@
                     }).
                         input({name: 'cn' }).
                         input({name: 'description'}).
+                        input({name: 'sambagrouptype'}).
                         input({name: 'gidnumber' }))).
         facet(
             IPA.group_member_user_facet({</pre>
<p>And then these the WebUI to ensure that you can both see the attribute in the group list, but also add it via the select widget added to the new/edit group dialog.</p>
<p>That should be it. Questions, comments, suggestions, correction and more… all are welcome!</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/05/ldap-user-management-tools-and-user-private-groups/' rel='bookmark' title='LDAP User Management Tools and User Private Groups'>LDAP User Management Tools and User Private Groups</a></li>
<li><a href='http://techslaves.org/2010/08/04/life-support/' rel='bookmark' title='Life Support!'>Life Support!</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2011/08/24/freeipa-and-samba-3-integration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LinuxCon 2011: Day 1</title>
		<link>http://techslaves.org/2011/08/17/linuxcon-2011-day-1/</link>
		<comments>http://techslaves.org/2011/08/17/linuxcon-2011-day-1/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 03:05:28 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[vendor]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=171</guid>
		<description><![CDATA[Today was the first day of LinuxCon North America 2011. I managed to received a free pass to the event via a contact at my place of employment which was in turn actually from Hewlett Packard. Thanks, JK and HP. Much appreciated. I arrived shortly after 8AM, registered to receive my badge and t-shirt then [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/26/is-ubuntu-ready-for-the-enterprise/' rel='bookmark' title='Is Ubuntu Ready for the Enterprise?'>Is Ubuntu Ready for the Enterprise?</a></li>
<li><a href='http://techslaves.org/2010/09/01/lvm-filters-and-initrd/' rel='bookmark' title='LVM filters and initrd'>LVM filters and initrd</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today was the first day of LinuxCon North America 2011. I managed to received a free pass to the event via a contact at my place of employment which was in turn actually from Hewlett Packard. Thanks, JK and HP. Much appreciated.</p>
<p>I arrived shortly after 8AM, registered to receive my badge and t-shirt then milled around the vendor booths until the keynotes were ready to start. I watched the keynotes (Jim Zemlin, Linux Foundation and Jim  Whitehurts, Red Hat), went to every session I could and came back to the main ballroom for the panel discussion with Jon &#8220;Maddog&#8221; Hall, Eben Moglen and Dan Frye and the following interview of Linus Torvalds by Greg Kroah-Hartman to wrap things up for day 1. So far, so good.</p>
<h1>The Keynotes</h1>
<p>Jim Zemlin&#8217;s opening keynote &#8220;Imagining a World Without Linux&#8221; was decent. While he did take some inevitable potshots at Microsoft, the message was generally very positive and uplifting. I won&#8217;t go into details but basically Jim described a world without Linux as one that would be black &amp; white as opposed to the colour filled world we know today (due to Linux). Jim is a smiley and positive person on stage, his style helped kick off LinuxCon 2011 with a good vibe.</p>
<p>Jim Whitehurst, CEO of Red Hat had a similar approach of sending positive vibes but focused on how the progress of Linux and Open Source has enabled businesses and business models. He said that Google wouldn&#8217;t exist (at least not in it&#8217;s current form) without Linux and basically implying the same about other major well know Linux-powered companies such as Amazon and Facebook. Jim struck me as a fairly modest fellow but he wasn&#8217;t shy about mentioning Red Hat&#8217;s penetration into Fortune 500 companies. Nor was he reserved about how Linux has powered, enabled, strongly driven by or directly benefitted various global forces that may or may not be angels (U.S. Navy, NSA, Russian Military, NYSE/Wall Street). While his examples spoke to the breadth of applications for and the wide reach of Linux, I couldn&#8217;t help but think about how the pervasiveness of Linux is not only helping drive great positive change int he world but may also be powering negative forces as well.</p>
<p>Overall both Jim&#8217;s did a good job and left me excited for the rest of LinuxCon to come.</p>
<h1>First Day Sessions</h1>
<p>I attended four sessions on day 1:</p>
<ol>
<li><em>Centralized User Administration with FreeIPA and sssd</em> by Stephen Gallagher</li>
<li><em>Watching Mad Men and Thinking About Open Source</em> by Karen Copenhaver</li>
<li><em>20 Years &#8211; And More &#8211; of Kernel Development</em> by Jon Cobert</li>
<li><em>What to Expect from Linux Storage</em> by James Bottomley</li>
</ol>
<h2>Centralized User Administration with FreeIPA and sssd</h2>
<p>My first LinuxCon session was by Stephen Gallagher of Red Hat. As is clear by the title, it was about FreeIPA and sssd, two emerging Red Hat driven projects relating to centralized directory and authentication services. Stephen wasn&#8217;t the most natural speaker I&#8217;ve had the pleasure to watch and I suspect that presentations aren&#8217;t something he does on a regular basis but he clearly knew his material and he was able to field the post-presentation questions with ease. The presentation material was fairly spot on to what I expected. I should stop by the Red Hat booth and speak with Stephen tomorrow as there are a few FreeIPA/sssd related questions I have which I didn&#8217;t ask during the question period. Overall, I was satisfied.</p>
<h2>Watching Mad Men and Thinking About Open Source</h2>
<p>First of all, Karen is a more natural speaker than Stephen but I suppose that&#8217;s to be expected: She is legal counsel for the Linux Foundation. The material in this session while clear and understandable was maybe not quite as impactful as I had hoped. Karen had some very nice points and brought good historical reference to the table but it wasn&#8217;t really anything that I didn&#8217;t already think think about in my own internal dialog, for the most part.</p>
<p>Some key points that Karen made early which did resonate with me:</p>
<ul>
<li>&#8220;It&#8217;s a privilege to work on something so important&#8221;, I believe she was quoting Linus Torvalds. This hits home for me as my work is only to enable the much more important and relevant work of others.</li>
<li>The observation that the open source community generally doesn&#8217;t have time for anything but the truth which is a nice ideal but perhaps isn&#8217;t necessarily reflective of the entire open source world so much as a few of the important luminaries.</li>
<li>Identify the things that you value and… well I missed that part. But I do think identifying the things you value is, well, valuable.</li>
</ul>
<p>These are all straight forward things but to hear someone say them can be powerful. This session was good but it wasn&#8217;t quite as hard hitting as I thought it might be based on the title and description. It was no let down, though.</p>
<h2>20 Year &#8211; And More &#8211; Of Linux Kernel Development</h2>
<p>Ok, now we&#8217;re getting way out of my league. Jon Corbet is a high profile Linux kernel contributor and he knows what he is talking about. This man has confidence and ostensibly the knowledge to back it up. His overview of the last 20 years of Linux kernel development was excellent and spotted with just enough humour to keep the real developers cracking up and the rest of us only getting every second joke.</p>
<p>Jon&#8217;s timeline approach to describing the history of kernel development was excellent and enabled him to visually map releases, events and growth in a very simple and understandable way. He made an excellent observation regarding the pace (measure by lines of code) of Linux kernel development during the dot com bust not slowing down one bit despite industry turmoil and job loss and pointed out the correlation between important points in Linux kernel development time with other events that may not be obvious to every outsider (BitKeeper, Git, time between certain releases, Merge Window, etc.).</p>
<p>While this session was developer focused, it wasn&#8217;t so technical to be devoid of value for anyone else, in fact I think it really helped frame the history of Linux kernel development for me in a way that I had never experienced before. Way to go, Jon.</p>
<h2>What To Expect From Linux Storage</h2>
<p>I&#8217;m not sure why James&#8217; talk was titled what it was because for the best of what I could tell, the majority of the talk was about what already is, not what to expect. That&#8217;s not to say it was devoid of important information regarding &#8220;what to expect&#8221; and maybe it was because James ran out of time and had to skip some slides but I did find the title interesting in that capacity none-the-less.</p>
<p>James is charismatic. He makes jokes, he wears a bow tie, he speaks with an attractive accent. He&#8217;s also clearly very knowledgable about his part of the Linux kernel: the Block layer.</p>
<p>Being a sysadmin, knowing more about the block layer and James&#8217; perspective on storage was hugely beneficial. He has historical reference that I never will and deep knowledge of the kernel which I&#8217;ll never achieve. With that said, some of his opinions regarding specific technologies and methods, I personally already held myself! How is it that a Linux kernel rube such as myself could had gleaned the same opinions on specific technologies as one of the people  who understands these technologies the best of anyone? iSCSI was an example. I think it&#8217;s safe to say James thinks iSCSI is an abhorrent mess that simply tries to solve a problem in entirely the wrong way. I&#8217;m also not a big fan of iSCSI and his reasoning  resonated with me, despite my lack of in depth knowledge.</p>
<p>I could go on because I liked this session but I already feel like I&#8217;m burning myself out on this summary of day 1 and we haven&#8217;t even gotten to the panel discussion or Linus interview yet.</p>
<h1>Panel Discussion</h1>
<p>The panel discussion with Jon Hall, Eben Moglen and Dan Frye was fairly profound despite Eben using the platform for an interesting but strangely placed speech that appeared entirely scripted/written. That&#8217;s not to say I didn&#8217;t like his speech or that I don&#8217;t agree with him or his world views but the way he momentarily took over the panel with what was clearly a pre-planned speech during a panel discussion main-hall format was strange indeed.</p>
<p>Dan Frye struck me as level-headed and one of those business people whom can take the challenge of  balancing the need to run a profitable business with social awareness and decency and excel at it. I&#8217;ve never really doubted IBM&#8217;s commitment to Linux and I know their commitment is based on profitability but the way that Dan framed the reasons that he and his team knew Linux meant good business for IBM put a smile on my face.</p>
<p>Jon Hall&#8217;s experience in the computing industry is staggering and humbling, even for today&#8217;s big shots. What a dude. Level head, very articulated, sense of humour and a huge white beard. It&#8217;s hard not to love the guy after watching that panel discussion. Jon talked about his hopes for how Linux and the open source model will foster the next generation of great thinkers, movers and shakers and enable them to do great things. I liked that.</p>
<p>I&#8217;m not really sure what to say about Eben. I agreed with everything he said but he just wasn&#8217;t as loveable as Jon Hall. Must be because he&#8217;s a lawyer :D I suppose that slightly awkward speech about the troubled times that are looming (mounting patent threats and inevitable &#8220;10-20 billion&#8221; dollar war) could have been a factor as well. That said, he seemed positive despite the heavy and serious tone he used to describe the battles ahead.</p>
<p>On one hand, the panel discussion left me feeling good and uplifted but on the other hand I was left with a feeling of powerlessness. I&#8217;m not one of the next great thinkers, doers or talkers. What&#8217;s my place in the Linux and open source world, then? Everything that was discussed revolved around the greatest minds in open source and the huge impacts made by major players. I almost felt a little left out as a lowly sysadmin whom has to deploy at least some non-RMS blessed systems alongside the requisite Linux systems. What&#8217;s my role in all this?</p>
<h1>Interview with Linus</h1>
<p>I really don&#8217;t have much to say about this one. Linus is down to earth, but strong in his opinions. He admits when something is outside of his immediate expertise, as evidenced by his answers to many non-Linux kernel specific questions. He talks well and he would have preferred if the crowd did not give him a standing ovation at the end but I suppose you cannot make a room full of Linux geeks sit down when their proverbial leader is being applauded.</p>
<p>I liked a lot of what Linus talked about regarding the modern direction of Linux such as the version numbering changes, the idea that we should be looking backwards at how to improve existing subsystems and layers instead of always looking forward to new feature inclusions. I liked how he described the cross-pollination of various parts of Linux that exist when everyone from embedded systems to massively parallel SMP systems are made to use the exact same kernel instead of everyone having their own specialized forks.</p>
<p>Linus was clam and cool, just like Linux and I had a seriously good time at LinuxCon today. Rock on, LinuxCon!</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/26/is-ubuntu-ready-for-the-enterprise/' rel='bookmark' title='Is Ubuntu Ready for the Enterprise?'>Is Ubuntu Ready for the Enterprise?</a></li>
<li><a href='http://techslaves.org/2010/09/01/lvm-filters-and-initrd/' rel='bookmark' title='LVM filters and initrd'>LVM filters and initrd</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2011/08/17/linuxcon-2011-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Browsing Automounted NFS with Nautilus</title>
		<link>http://techslaves.org/2011/05/13/browsing-automounted-nfs-with-nautilus/</link>
		<comments>http://techslaves.org/2011/05/13/browsing-automounted-nfs-with-nautilus/#comments</comments>
		<pubDate>Fri, 13 May 2011 20:18:18 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[autofs]]></category>
		<category><![CDATA[automount]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nautilus]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[slow]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=152</guid>
		<description><![CDATA[Has browsing automounted NFS shares with nautilus got you pulling out hair in frustration? Ever since we transitioned from the RHEL4 environment to Fedora 14, people have been reporting terrible slowness and delays in nautilus when browsing our NFS shares. Reports of waiting over a minute for an NFS automount root-level directory with &#60; 100 [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
<li><a href='http://techslaves.org/2010/10/26/is-ubuntu-ready-for-the-enterprise/' rel='bookmark' title='Is Ubuntu Ready for the Enterprise?'>Is Ubuntu Ready for the Enterprise?</a></li>
<li><a href='http://techslaves.org/2010/04/23/posix-default-acls-umask-and-project-directories/' rel='bookmark' title='POSIX Default ACLs, umask and Project Directories'>POSIX Default ACLs, umask and Project Directories</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Has browsing automounted NFS shares with nautilus got you pulling out hair in frustration? </p>
<p>Ever since we transitioned from the RHEL4 environment to Fedora 14, people have been reporting terrible slowness and delays in nautilus when browsing our NFS shares. Reports of waiting over a minute for an NFS automount root-level directory with &lt; 100 sub directories to display the contents are not good.</p>
<p>This wasn&#8217;t a problem on our old RHEL4 terminal server and I couldn&#8217;t for the life of me understand how nautilus could have become so slow in the years since RHEL4 was released. It just didn&#8217;t make sense. I started to think something had to be wrong and that this wasn&#8217;t just the new normal expected behaviour but I had nothing to go on.</p>
<p>I tried the basic recommendations: Disable thumbnails, disable preview, disable directory item counts. That didn&#8217;t help the user experience in any dramatic way. At this point, I started recommended pcmanfm and thunar as a way to workaround nautilus&#8217; terrible performance. I even wrote a fairly concise script for modifying the default file manager and desktop-drawing application so that using a different file manager wouldn&#8217;t be so foreign in GNOME.</p>
<p>Then one day I started looking at the verbose level output from automount while browsing the NFS mounts with nautilus and found a substantial amount of this in the logs:</p>
<pre>Apr 28 11:19:10 hostname automount[18959]: attempting to mount entry /home/.svn
Apr 28 11:19:10 hostname automount[18959]: key ".svn" not found in map source(s).
Apr 28 11:19:10 hostname automount[18959]: failed to mount /home/.svn
</pre>
<p>Oh my! Why are there repeated access attempts for &#8220;.svn&#8221;? What is causing automount to perform map lookups for &#8220;.svn&#8221; in the automount-controlled directories? Could it be nautilus?</p>
<p>Why yes!</p>
<p>As it turns out the GNOME SVN integration package &#8220;gnubversion&#8221; includes a nautilus extension and this extension was causing Nautilus to look for &#8220;.svn&#8221; directories everywhere and it just so happens that looking for &#8220;.svn&#8221; in a root-level automount directory causes slow map lookup failures that (presumably) kill the perceptible performance of browsing automounted NFS shares.</p>
<p>I removed gnubversion (as no one was using it) and the user experience for nautilus has normalized. While nautilus still isn&#8217;t as speedy as pcmanfm or thunar, its no longer a cause of forceful hair removal incidents&#8230; and all is well in the world.</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
<li><a href='http://techslaves.org/2010/10/26/is-ubuntu-ready-for-the-enterprise/' rel='bookmark' title='Is Ubuntu Ready for the Enterprise?'>Is Ubuntu Ready for the Enterprise?</a></li>
<li><a href='http://techslaves.org/2010/04/23/posix-default-acls-umask-and-project-directories/' rel='bookmark' title='POSIX Default ACLs, umask and Project Directories'>POSIX Default ACLs, umask and Project Directories</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2011/05/13/browsing-automounted-nfs-with-nautilus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m in z-push Limbo</title>
		<link>http://techslaves.org/2010/10/16/im-in-z-push-limbo/</link>
		<comments>http://techslaves.org/2010/10/16/im-in-z-push-limbo/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 06:32:04 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[activesync]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[push]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=97</guid>
		<description><![CDATA[Sparked by the purchase of a new phone with Internet connectivity and native support for push email (ableit with ActiveSync), I decided to see what I could do about pushifying the IMAP server at work. We run Dovecot 1.1 with a MySQL backend and Postfix for MTA duties. Everything requires both TLS and SSL for [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/09/01/when-using-syncrepl/' rel='bookmark' title='When using Syncrepl&#8230;'>When using Syncrepl&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sparked by the <a href="/2010/10/13/so-i-bought-a-new-phone/">purchase of a new phone</a> with Internet connectivity and native support for push email (ableit with ActiveSync), I decided to see what I could do about pushifying the IMAP server at work.</p>
<p>We run Dovecot 1.1 with a MySQL backend and Postfix for MTA duties. Everything requires both TLS and SSL for authentication and everything requires authentication except for sending mail from the local subnet. It works pretty well. I never touch the thing anymore, it just runs. However, it doesn&#8217;t support push email and it certainly doesn&#8217;t support ActiveSync. So I went looking for something that could do push email to my spankin&#8217; new phone.</p>
<p>I was surprisingly happy to discover <a href="http://z-push.sourceforge.net/">z-push</a>, an open source, standalone ActiveSync implementation in PHP. Well hot damn!</p>
<p>I initially installed the latest stable release, but then quickly tried the SVN trunk for any potential fixes that have yet to make it out to the stable release because I wasn&#8217;t having much success. After a few simple problems got resolved and I was updated to the SVN trunk things started to work&#8230; kind of. The initial sync takes forever! I didn&#8217;t have the patience to wait for all my mail to download because it appeared to be taking several <em>minutes</em> per email. The folder list loaded right up and my nearly empty inbox too but any folder with more than a few messages was taking forever to sync. Not to mention the apache server started to churn CPU pretty hard on the server. Also, it seemed the sync would only even start to work if I had &#8220;No Limit&#8221; selected on the iPhone for history of emails to sync. Maybe the large volume initial sync by using &#8220;No Limit&#8221; is just too taxing and that&#8217;s why it&#8217;s brutally slow but I kept getting &#8220;Cannot Get Mail &#8211; The connection to the server failed.&#8221; on my iPhone if I selected any option besides &#8220;No Limit&#8221;.</p>
<p>On top of that, push didn&#8217;t work!</p>
<p>I&#8217;ll keep plugging away at it next week, maybe post on the z-push forums to see if I can get this figured out. Cheers for now.</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/09/01/when-using-syncrepl/' rel='bookmark' title='When using Syncrepl&#8230;'>When using Syncrepl&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/10/16/im-in-z-push-limbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wxPython is Kicking my Ass!</title>
		<link>http://techslaves.org/2010/10/14/wxpython-is-kicking-my-ass/</link>
		<comments>http://techslaves.org/2010/10/14/wxpython-is-kicking-my-ass/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 21:53:14 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Updates]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[wxPython]]></category>
		<category><![CDATA[wxWidgets]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=95</guid>
		<description><![CDATA[Let me preface by saying that I&#8217;m not a programmer nor software developer nor anything of the sorts. I&#8217;m a sysadmin with scripting skills to solve automation problems, for the most part. I took all the C++ classes in High School but I never pursued software development as a serious academic interest or career. I [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Let me preface by saying that I&#8217;m not a programmer nor software developer nor anything of the sorts. I&#8217;m a sysadmin with scripting skills to solve automation problems, for the most part. I took all the C++ classes in High School but I never pursued software development as a serious academic interest or career. I know &#8220;about&#8221; software development and it&#8217;s practices but I don&#8217;t feel that I have any particularly interesting skills in the field.</p>
<p>Now that I want to write a site-specific GUI-based LDAP management tool as referenced in a <a href="/2010/10/05/ldap-user-management-tools-and-user-private-groups/">previous post</a>, I&#8217;m jumping back into software development a little bit. I&#8217;ve decided to use wxPython for a few reasons. We already use it within our group, we have in-house expertise in the form of an actual developer and the GUI-builder tools seem to work best with wxPython (wxGlade was producing bad wxPerl code, go figure).</p>
<p>Let me also say that I&#8217;ve never been a big python guy. I&#8217;m really a perl kind of dude, so this learning a new object oriented API while learning python at the same time is a challenge&#8230; but I&#8217;m making progress! Basically, wxPython seriously kicked my ass for about 3 days but now I&#8217;m gaining speed and things are moving faster than I expected. Python and wxPython are starting to make more sense and behave.</p>
<p>So far I have a frame with menubar, statusbar and a three-tabbed notebook with a grid on each tab of the notebook. The program is able to connect to an LDAP server (with TLS) and query the directory for all the users, groups and autofs information and then display that information in the grid&#8230; and that&#8217;s about it so far. I need to build in new user, group and autofs functionality as well as basic editing of existing entries (in place editing with wx.Grid looks really nice but I haven&#8217;t tried it yet!).</p>
<p>Although my ass has been kicked for the last few days, I&#8217;m actually feeling pretty optimistic about it now.</p>
<p>Hopefully I can share the kludge code at some point, though it will never be easily transportable to different environments since I&#8217;m not building this to be the end-all-be-all LDAP user/group/autofs management tool, just one tailored for our environment.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/10/14/wxpython-is-kicking-my-ass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LDAP User Management Tools and User Private Groups</title>
		<link>http://techslaves.org/2010/10/05/ldap-user-management-tools-and-user-private-groups/</link>
		<comments>http://techslaves.org/2010/10/05/ldap-user-management-tools-and-user-private-groups/#comments</comments>
		<pubDate>Tue, 05 Oct 2010 23:08:58 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[ldap openldap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=92</guid>
		<description><![CDATA[Is it just me or are there no LDAP user management tools that support User Private Groups (UPG)? I&#8217;m well aware of the FreeIPA project and that project does in fact support UPG, probably because it&#8217;s a RedHat project but I&#8217;ve determined that FreeIPA is too comprehensive for my needs. Despite Kerberos being the &#8220;right&#8221; [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2011/03/08/which-distro-for-ppc64-server/' rel='bookmark' title='Which Distro for PPC64 Server?'>Which Distro for PPC64 Server?</a></li>
<li><a href='http://techslaves.org/2011/08/24/freeipa-and-samba-3-integration/' rel='bookmark' title='FreeIPA and Samba 3 Integration'>FreeIPA and Samba 3 Integration</a></li>
<li><a href='http://techslaves.org/2010/09/08/migration-weekend-success/' rel='bookmark' title='Migration Weekend: Success'>Migration Weekend: Success</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Is it just me or are there no LDAP user management tools that support User Private Groups (UPG)?</p>
<p>I&#8217;m well aware of the <a href="http://www.freeipa.org/">FreeIPA</a> project and that project does in fact support UPG, probably because it&#8217;s a RedHat project but I&#8217;ve determined that FreeIPA is too comprehensive for my needs. Despite Kerberos being the &#8220;right&#8221; solution in every sense of the term, I&#8217;d rather have the simplicity of binding to the LDAP server for authentication, even though I know that using LDAP as an authentication service is &#8220;wrong&#8221;.</p>
<p>My question, loyalty challenged readers, is: Are there any LDAP user management tools out there that support UPG?</p>
<p>Let me start the list:</p>
<ul>
<li>LAM &#8211; NO</li>
<li>phpLDAPadmin &#8211; NO</li>
<li>Luma &#8211; NO</li>
<li>LAT &#8211; NO</li>
<li>Gosa &#8211; NO</li>
<li>smbldap-tools &#8211; Maybe?</li>
</ul>
<p>Not to bash any of those tools, but I&#8217;ve decided to start writing my own simple &#8220;useradd&#8221; script for now because the workflow for creating a user with the UPG scheme with any of these tools is an annoying multi-step process. While my solution is site-specific and non-comprehensive, it just exactly the job I need done, done. And fast. I used perl and Net::LDAP, among other modules. Once I figured out if I want to it keep it on the console or move it to the web, I&#8217;ll post the results&#8230; even if it won&#8217;t be useful to anyone as-is.</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2011/03/08/which-distro-for-ppc64-server/' rel='bookmark' title='Which Distro for PPC64 Server?'>Which Distro for PPC64 Server?</a></li>
<li><a href='http://techslaves.org/2011/08/24/freeipa-and-samba-3-integration/' rel='bookmark' title='FreeIPA and Samba 3 Integration'>FreeIPA and Samba 3 Integration</a></li>
<li><a href='http://techslaves.org/2010/09/08/migration-weekend-success/' rel='bookmark' title='Migration Weekend: Success'>Migration Weekend: Success</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/10/05/ldap-user-management-tools-and-user-private-groups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cfengine 3 Snippets Part 2: sudo</title>
		<link>http://techslaves.org/2010/10/02/cfengine-3-snippets-part-2-sudo/</link>
		<comments>http://techslaves.org/2010/10/02/cfengine-3-snippets-part-2-sudo/#comments</comments>
		<pubDate>Sat, 02 Oct 2010 02:59:42 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=87</guid>
		<description><![CDATA[It&#8217;s been a while since I&#8217;ve really had time to delve too much further into cfengine 3 since my previous post on the subject way back in May but I do have another simple example to share. This time it&#8217;s about managing your sudo policy via the sudoers file. The example is that of a very, [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/' rel='bookmark' title='Cfengine 3 Snippets Part 1: DenyHosts'>Cfengine 3 Snippets Part 1: DenyHosts</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I&#8217;ve really had time to delve too much further into cfengine 3 since my <a href="http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/">previous post</a> on the subject way back in May but I do have another simple example to share. This time it&#8217;s about managing your sudo policy via the <em>sudoers</em> file.</p>
<p>The example is that of a very, very basic <em>sudoers</em> policy but the principles are easily extended to create much more complex policy. The general idea here is that we want cfengine to ensure that specific rules are always in place. Instructed properly, cfengine accomplishes this very well.</p>
<p>Warning: I don&#8217;t know anything. I&#8217;m just someone learning cfengine 3 and posting about it. If I&#8217;m wrong about something, let me know! If you find this at all useful, be my guest. That is all.</p>
<p><span id="more-87"></span></p>
<pre>################################################################################
##
## FILE: sudo.cf
## DESC: Control /etc/sudoers file on various servers
##
################################################################################

bundle agent sudo
{

vars:

  "sudoers" string =&gt; "/etc/sudoers";

  "sudo"     slist =&gt; {
                      "%admin ALL = ALL",
                      "%sysadmin ALL = /sbin/mount",
                      "%devel ALL = /sbin/mount"
                      };

packages:

  Night::

  "sudo" -&gt; "Security policy"
    comment               =&gt; "Ensure sudo is up to date every 24 hours (and only at night)",
    package_policy        =&gt; "update",
    package_method        =&gt; yum,
    package_architectures =&gt; { "$(sys.arch)" },
    action                =&gt; if_elapsed("1440");

files:

  "$(sudoers)" -&gt; "Security Policy"
    comment      =&gt; "Append common configuration to sudoers",
    edit_line    =&gt; append_if_no_lines("$(sudo)");

}</pre>
<p>As with last snippet I posted, the above does not even resemble a complete cfengine policy/configuration, just a small portion that can be contained in it&#8217;s own bundle. It can be put in a separate .cf file, imported by promises.cf and added to the bundle sequence, inheriting variables and classes! Also, just like last time I&#8217;m using cfengine&#8217;s built in interface for package management systems to ensure &#8220;sudo&#8221; is always installed via yum at night, every 24 hours.</p>
<p>What&#8217;s new here is file editing with <em>edit_line</em> and the use of iteration which proves to be very powerful in cfengine 3.</p>
<h2>Editing Files</h2>
<p>Editing files with cfengine is supposed to be easy but initially it seemed a bit awkward to me.</p>
<p>First you have the promise file promise:</p>
<pre>files:

  "$(sudoers)" -&gt; "Security Policy"
    comment      =&gt; "Append common configuration to sudoers",
    edit_line    =&gt; append_if_no_lines("$(sudo)");</pre>
<p>Which makes some reference to the <em>edit_line</em> facility and what looks like a function name with <em>append_if_no_lines(&#8230;)</em>.</p>
<p>Then you have the <em>edit_line</em> bundle defined elsewhere:</p>
<pre>bundle edit_line append_if_no_lines(list)
{
insert_lines:

 "$(list)";
}</pre>
<p>Which describes what &#8220;append_if_no_lines&#8221; actually does.</p>
<p>Of course I&#8217;m just learning cfengine and new things can often seem strange and scary but I am finally warming up to editing files with cfengine&#8230; I think. What I seemed to have initial trouble with was with the <em>bundles</em> necessary for <em>edit_lines</em>, as described above. The bundle within a bundle concept. The <em>append_if_no_lines</em> and <em>append_if_no_line</em> bundles I&#8217;m using are implemented in the <a href="http://www.cfengine.org/manuals/cfengine_stdlib.cf">cfengine std library</a>, which is highly recommended so that you may avoid re-inventing the wheel a little bit.</p>
<p>For basic promises, to add or remove, comment or uncomments lines and the such there are good <em>edit_lines</em> bundles available in the stdlib. For other more complex or customized file editing, writing your own bundles will be necessary. Either way, understanding what a <em>bundle</em> is and how to create your own is key to fully grasping file editing and getting the most out of it. This seems obvious in retrospect but something I didn&#8217;t pickup instantly.</p>
<p>See the cfengine documentation for more about editing files, check the cfengine documentation. There&#8217;s waaaaay more good information over there and it&#8217;s from the cfengine team, not some random newb.</p>
<h2><strong>Iteration</strong></h2>
<p>Iteration is powerful mechanism within cfengine that harnesses the power of lists to express a large possible number of actions/operations with very little amount of code. When lists are used, single actions can be made to repeat for every item in a list by using the <em>$(varname)</em> syntax to refer to the list&#8230; which as it turns out is the same for scalar values! Funny that!</p>
<p>So cfengine allows us to define X different lines of code to ensure are in a file using only a single <em>file:</em> promise all with the same simple syntax as scalar variables? Brilliant!</p>
<p>A demonstration of iteration can be seen with the <em>$(sudo)</em> slist and the &#8220;Append common configuration to sudoers&#8221; <em>file:</em> promise. With this single promise definition, <em>up to</em> 6 actual promises are made because the <em>$(sudo)</em> variable is an slist. Each element or item in the list is iterated over in sequence and the promise is evaluated and acted upon, if necessary. The reason that <em>up to</em> 6 promises will be evaluated is the <em>ifvarclass</em> property of promise, ensuring the promise will only be kept if we&#8217;re in the context of the class&#8230; and looking at the promise to find out which class, we see another example of iteration using the <em>$(sudo)</em> list and the <em>canonify</em> function that turns a string into a class. Thusly, if the host currently running this policy defines all the classes that are tested by the <em>ifvarclass</em> iteration, 6 promises will be made. If the host defines 3 of the classes, then 3 promises will be made and so on, and so forth.</p>
<p>As a beginner, using lists and iteration effectively and creatively seems fairly important to getting the most out of cfengine 3.</p>
<h2>Editing Files vs. Copying Files</h2>
<p>In my previous snippet, I demonstrated how to promise to copy a file from a secure remote server if the local file does not match the server&#8217;s file in order to manage a configuration with cfengine. This time, I&#8217;m promising to add lines to a configuration file if they do not already exist exactly as provided.</p>
<p>This represents two rather different takes on policy. The first says: &#8220;The configuration must always be exactly like this file, byte per byte!&#8221; the second says &#8220;These lines must exist but I don&#8217;t care about anything else in the file&#8221;. The file copy method is what I would call hard policy and the second is soft policy. In the cfengine community solutions, they recommend managing sudo by copying an <em>/etc/sudoers</em> from a remote server. That way is great (just like my DenyHosts example) but this is just another way if you have a use case for cfengine not owning every byte of your configuration file.</p>
<h2>Conclusion</h2>
<p>Yeah, that&#8217;s about it. Enjoy.</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/' rel='bookmark' title='Cfengine 3 Snippets Part 1: DenyHosts'>Cfengine 3 Snippets Part 1: DenyHosts</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/10/02/cfengine-3-snippets-part-2-sudo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migration Weekend: Success</title>
		<link>http://techslaves.org/2010/09/08/migration-weekend-success/</link>
		<comments>http://techslaves.org/2010/09/08/migration-weekend-success/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 18:00:50 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[iscsi]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tina]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=80</guid>
		<description><![CDATA[It was a long weekend of watching tape restores and restarting them as necessary but it&#8217;s finally over and everything appears to be mostly hunky dory! I did discovery yet more small misconfigurations and strange behaviour along the way: OpenLDAP&#8217;s syncrepl using &#8220;refereshAndPersist&#8221; wasn&#8217;t working how I expected it to, no new changes were replicating [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/09/04/migration-weekend/' rel='bookmark' title='Migration Weekend'>Migration Weekend</a></li>
<li><a href='http://techslaves.org/2010/09/01/when-using-syncrepl/' rel='bookmark' title='When using Syncrepl&#8230;'>When using Syncrepl&#8230;</a></li>
<li><a href='http://techslaves.org/2010/05/05/atempo-time-navigator-4-2-archive-media-selection-tunable/' rel='bookmark' title='Atempo Time Navigator 4.2 Archive Media Selection Tunable'>Atempo Time Navigator 4.2 Archive Media Selection Tunable</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>It was a long weekend of watching tape restores and restarting them as necessary but it&#8217;s finally over and everything appears to be mostly hunky dory!</p>
<p>I did discovery yet more small misconfigurations and strange behaviour along the way:</p>
<ol>
<li>OpenLDAP&#8217;s syncrepl using &#8220;refereshAndPersist&#8221; wasn&#8217;t working how I expected it to, no new changes were replicating to the slave LDAP server! I changed the directive to &#8220;refreshOnly&#8221; and set a 10 minute interval. I made several changes and monitored the slave LDAP server. Changes propagated in about 10 minutes, every time.</li>
<li>Despite iSCSI&#8217;s maturity and the maturity of QLogic&#8217;s HBAs I still noticed strange, unexplained target drop outs. Two HBAs per server, two controllers in the IBM DS3300 and just one target out of four was dropping. At first, I couldn&#8217;t figure out how to properly reconnect the target on a live system so I rebooted. Later, I discovered you can &#8220;disable&#8221; and then &#8220;enable&#8221; the specific target in SANsurfer or iscli, which worked to bring back the dropped target on a live system. Multipath picked up the &#8220;new&#8221; path right away, as expected.</li>
<li>Always remember to leave free physical extents in any LVM Volume Group in which you are taking snapshots of the Logical Volumes. It&#8217;s freakin&#8217; obvious but I forgot and when I went to do snapshot backups, the snapshots were failing. Now I&#8217;m growing some LUNs on the DS3300 so that my VGs have room for snapshots.</li>
</ol>
<p>All in all, a good weekend that was mostly filled with success.</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/09/04/migration-weekend/' rel='bookmark' title='Migration Weekend'>Migration Weekend</a></li>
<li><a href='http://techslaves.org/2010/09/01/when-using-syncrepl/' rel='bookmark' title='When using Syncrepl&#8230;'>When using Syncrepl&#8230;</a></li>
<li><a href='http://techslaves.org/2010/05/05/atempo-time-navigator-4-2-archive-media-selection-tunable/' rel='bookmark' title='Atempo Time Navigator 4.2 Archive Media Selection Tunable'>Atempo Time Navigator 4.2 Archive Media Selection Tunable</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/09/08/migration-weekend-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time Navigator HA Cluster Agent Configuration</title>
		<link>http://techslaves.org/2010/08/05/time-navigator-ha-cluster-agent-configuration/</link>
		<comments>http://techslaves.org/2010/08/05/time-navigator-ha-cluster-agent-configuration/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 22:40:53 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[atempo]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tina]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=68</guid>
		<description><![CDATA[I&#8217;ve been wanting to post about a configuration that allows for seamless file-level backup of storage attached to an active/passive high availability cluster in an uninterrupted fashion using Atempo&#8217;s Time Navigator and I&#8217;m finally going to do it. The Problem The initial difficulty lies in the requirement that the data must be consistently backed up [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/05/atempo-time-navigator-4-2-archive-media-selection-tunable/' rel='bookmark' title='Atempo Time Navigator 4.2 Archive Media Selection Tunable'>Atempo Time Navigator 4.2 Archive Media Selection Tunable</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
<li><a href='http://techslaves.org/2010/09/08/migration-weekend-success/' rel='bookmark' title='Migration Weekend: Success'>Migration Weekend: Success</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to post about a configuration that allows for seamless file-level backup of storage attached to an active/passive high availability cluster in an uninterrupted fashion using Atempo&#8217;s Time Navigator and I&#8217;m finally going to do it.</p>
<h3>The Problem</h3>
<p>The initial difficulty lies in the requirement that the data must be consistently backed up at every interval, no matter which cluster node is currently the active node with the backend storage mounted. To do this, an agent is required to be configured as a cluster resource in order to &#8220;follow&#8221; the mounting/exporting of the storage to any cluster node. So in order to accomplish this,  N + 1 tina agents are required. That is, if you have two cluster nodes, you need three agents to successfully backup each node with the local agent and the storage, as it floats about the cluster nodes depending on failure or migration events.</p>
<p>Luckily for me, the good people at Atempo have engineered the agent in such a way that multiple agents can be ran on a single node, each binding to it&#8217;s own IP address and each individually controlled via it&#8217;s own init script. Of course, we need to make some file edits to make all this happen and that&#8217;s what I&#8217;m going share!</p>
<p><span id="more-68"></span></p>
<h3>System Configuration</h3>
<p>This configuration is based on CentOS 5.x and Time Navigator 4.2 but should the concepts should be mostly portable to other popular Linux or UNIX distributions. The underlying cluster software used for the majority of my experience with this configuration is Heartbeat 2.1.3, right before the Pacemaker split but has also been more recently tested on Pacemaker 1.0 / Heartbeat 3.0.x. DRBD is used to provide the active/passive cluster-aware state and configuration information to where I&#8217;ve installed the Atempo Time Navigator agent but it is possible to install a second agent on each cluster node and configure it identically but this just seems like more work. DRBD does a great job of making sure the latest cluster-aware tina agent is consistently configured and available on the active cluster node, no matter which node that actually is.</p>
<p>For the purpose of this post, I&#8217;m going to assume you already have a working Heartbeat/Pacemaker/DRBD configuration up and running with proper STONITH and all that good jazz. Maybe some other time.</p>
<h3>Installing and Configuring the Agent on DRBD</h3>
<p>The first thing that needs to be done is the tina agent must be installed to a filesystem hosted on DRBD. I generally just SSH around the Linux-X64.tar or Linux-X86.tar Time Navigator installation archive and then decompress and run the install script.</p>
<p>Assuming the dedicated (to this agent resource) DRBD filesystem is mounted as <em>/cluster/tina</em> on the active cluster node:</p>
<pre>$ cd /cluster/tina
$ scp user@remote.fqdn:/path/to/Linux-X86.tar ./
$ tar -xf Linux-X86.tar
$ cd Linux-X86
$ ./install.sh</pre>
<p>This will bring up the GUI installer. Alternatively use the batch install method, whatever works for you.</p>
<p>Set <em>/cluster/tina </em>as the installation directory and otherwise proceed normally as per site configuration. Unique ports do not need to be used for the second cluster agent as this configuration bind to a floating cluster resource IP address while the local agent binds to (one of) the servers &#8220;real&#8221; IP address(es).</p>
<p>Once installed, there is one important edit to make in the tina agent environment configuration scripts named <em>.tina.sh (sh/bash) </em>and <em>.tina.csh (csh/tcsh) </em>located in the installation directory (<em>/cluster/tina</em>). The key change to make in the relevant script<em> </em>is to modify the value where the $<em>TINA</em> environment variable is being set. In <em>.tina.sh</em> that would be changing the line:</p>
<pre>TINA=tina</pre>
<p>to instead read something like this:</p>
<pre>TINA=tina_ha</pre>
<p>where <em>tina_ha</em> is a unique identifier for this instance of the agent. Basically, it needs to be anything BUT <em>tina</em>. This is one of two key components that had me tricked for a while. I had first tried modifying the $<em>TINA_SERVICE_NAME</em> environment variable but that was a giant red herring because uniquely setting that variable to something other than <em>tina</em> does not produce the desired effect, despite what the looking through the tina environment scripts and init scripts might have you believe.</p>
<p>The second thing we must do is to create an LSB-compliant init script for the cluster-aware tina agent. The LSB compliance is very important to ensure the cluster can manage the resource properly. If any return codes are out of the LSB spec, the cluster will behave erratically and unpredictably when dealing with starting, stopping and monitoring the tina agent.</p>
<p>Since the installation creates a good init script for us, we can copy that script with a new name and edit it.</p>
<pre>$ cp /etc/init.d/tina.tina /etc/init.d/tina.tina_ha
$ nano /etc/init.d/tina.tina_ha</pre>
<p>First, replace every instance of the path to the local agent&#8217;s tina install path with that of the cluster agent&#8217;s installation path. A simple search (Ctrl-W) then replace (Cntrl-R) in nano should suffice.</p>
<p>Additionally, we need a small section at the top that will exit the script in case the DRBD filesystem is not mounted. The HA cluster will do resource status checks on all nodes in the cluster and we need the init script to be able to exit with a sane exit code, even if the DRBD filesystem is not accessible (as it is on all passive nodes). Something like this:</p>
<pre>if [ -f /cluster/tina/.tina.sh ] ; then
  . /cluster/tina/.tina.sh &gt; /dev/null 2&gt;&amp;1
else
  echo "Unable to start Time Navigator daemon"
  echo "because the \"/cluster/tina/.tina.sh\" file does not exist"
  retval=3
fi</pre>
<p>In order to make the script LSB compliant, we need to ensure the correct exit status is returned during the correct operations. Instead of pointing out each specific place I had to edit in order for this to happen, I will simply post my entire &#8220;<em>/etc/init.d/tina.tina_ha</em>&#8221; init script:</p>
<pre>#!/bin/sh
# UPDATED BY SETUP - BEGIN
########################################################
#WARNING :
#THIS FILE IS GENERATED AUTOMATICALLY
#AND WILL BE OVERWRITTEN WHEN UPGRADING
#YOUR VERSION OF Time Navigator PRODUCT
########################################################
PATH="$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
export PATH
if [ "${TINA_HOME:+$TINA_HOME}" != "" ] ; then
	if [ "/cluster/tina" != "$TINA_HOME" ] ; then
		echo "Unable to start Time Navigator daemon for \"/cluster/tina\""
		echo "because the Time Navigator environment is already set by \"$TINA_HOME\""
		retval=3
	fi
fi
if [ -f /cluster/tina/.tina.sh ] ; then
	. /cluster/tina/.tina.sh &gt; /dev/null 2&gt;&amp;1
else
	echo "Unable to start Time Navigator daemon"
	echo "because the \"/cluster/tina/.tina.sh\" file does not exist"
	retval=3
fi
# UPDATED BY SETUP - END
# @(#) $Id: rc.tina.orig,v 1.1.6.10.4.4.2.4 2007/09/20 16:26:50 dle Exp $
#
# Time Navigator startup script
# (C) 1999-2005 - Atempo
# tina_daemon starting...
#

OS_TYPE=`uname -s`

if echo "\c" | grep "c"&gt;/dev/null ; then
	ECHOMODE=Bsd
else
	ECHOMODE=Sys5
fi

ECHONOCR() {
	if [ "$ECHOMODE" = Bsd ] ; then
		echo -n "$*"
	else
		echo "$*\c"
	fi
}

PING() {
    os_type=`uname -s`
    case $os_type in
        HP-UX) result=`ping $1 -n 2 2&gt;/dev/null`; return $?;;
        *) result=`ping -c 2 $1 2&gt;/dev/null`; return $?;;
    esac
}

ISREDHATLIKE=1
# Source function library.
if [ -f /etc/init.d/functions ] ; then
	. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
	. /etc/rc.d/init.d/functions
else
	ISREDHATLIKE=0
fi

ISSUSE=1
if [ -f /etc/rc.status ] ; then
	. /etc/rc.status
else
	ISSUSE=0
fi

RCStart()
{
	if [ -x ${TINA_HOME}/Bin/ndmpd ] ; then
		echo "Starting NDMP Data Server..."
		${TINA_HOME}/Bin/ndmpd
	elif [ -x ${TINA_HOME}/Bin/tina_nts ] ; then
		echo "Starting NDMP Tape Server..."
		${TINA_HOME}/Bin/tina_nts
	fi

	TINA_DAEMON=$TINA_HOME/Bin/tina_daemon
	if [ -x "$TINA_DAEMON" ]; then
		ECHONOCR "Starting Time Navigator ($TINA_SERVICE_NAME)..."
		if [ -d /var/lock/subsys ] ; then
			touch /var/lock/subsys/tina.$TINA_SERVICE_NAME
		fi
		i=1
		while [ $i -le 60 ] ; do
			if [ $OS_TYPE = "Darwin" ] ; then
				echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon" &gt;&gt; /var/log/system.log
			fi
			echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon $i" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
			hostname=`hostname 2&gt;/dev/null`
			if [ ! -z "$hostname" ] ; then
				echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon: hostname $hostname is defined" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
				PING $hostname
				status=$?
				if [ $status -eq 0 ] ; then
					echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon: ping $hostname is ok" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
					$TINA_DAEMON
					sleep 2
					RCStatus no_mess
					if [ ! -z "$is_running" ] ; then
						if [ $OS_TYPE = "Darwin" ] ; then
							echo `date` "tina_daemon ($TINA_SERVICE_NAME) daemon is started" &gt;&gt; /var/log/system.log
						fi
						echo `date` "tina_daemon ($TINA_SERVICE_NAME) daemon is started" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
						break
					else
						echo `date` "tina_daemon ($TINA_SERVICE_NAME) daemon is not started" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
					fi
				else
					echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon: ping $hostname is ko" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
				fi
			else
				echo `date` "Trying to start tina_daemon ($TINA_SERVICE_NAME) daemon: hostname is not defined" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
			fi
			sleep 5
			i=`expr $i + 1`
		done

		if [ $ISREDHATLIKE -eq 1 ]; then
			echo_success
			echo
		elif [ $ISSUSE -eq 1 ]; then
			rc_status -v
		else
			echo
		fi

		# Start ACSLS daemons (mini_el and ssi)
		if [ -d "$TINA_HOME/Vtl" ] ; then
			for VL_path in $TINA_HOME/Vtl/*
			do
				[ ! -d $VL_path ] &amp;&amp; continue
				VL_name=`basename $VL_path`
				if [ $VL_name = "Install" -o $VL_name = "Bin" -o $VL_name = "Log" -o $VL_name = "Tmp" ] ; then
					continue
				fi

				# If there is no tina_stk.conf, give up
				[ ! -f "$VL_path/tina_stk.conf" ] &amp;&amp; continue

				[ ! -x "$TINA_HOME/Vtl/Bin/ACSLS/start.sh" ] &amp;&amp; continue

				ECHONOCR "Starting ACSLS client daemon for $VL_name virtual library ..."
				$TINA_HOME/Vtl/Bin/ACSLS/start.sh $VL_name
				echo
			done
		fi
	elif [ ! -f ${TINA_HOME}/.ndmp.sh ] ; then
		if [ $ISREDHATLIKE -eq 1 ]; then
			ECHONOCR "Starting Time Navigator (${TINA_SERVICE_NAME})..."
			echo_failure
			echo
		elif [ $ISSUSE -eq 1 ]; then
			rc_failed 1
		else
			echo
		fi
	fi
}

RCStop()
{
	#Stop ndmp daemon
	NDMPDAEMON=""
	if [ -x ${TINA_HOME}/Bin/ndmpd ] ; then
		NDMPDAEMON="ndmpd"
	elif [ -x ${TINA_HOME}/Bin/tina_nts ] ; then
		NDMPDAEMON="tina_nts"
	fi
	if [ ! -z "$NDMPDAEMON" ] ; then
		file="/var/tmp/$NDMPDAEMON.pid"
		if [ -f $file ] ; then
			if [ "$NDMPDAEMON" = ndmpd ] ; then
				echo "Shutting down NDMP Data Server..."
			elif [ "$NDMPDAEMON" = tina_nts ] ; then
				echo "Shutting down NDMP Tape Server..."
			fi
			kill `cat $file`
		fi
	fi

	#Stop Time Navigator daemon
	if [ -x ${TINA_HOME}/Bin/tina_stop ]; then
		if [ -d /var/lock/subsys ] ; then
			rm -f /var/lock/subsys/tina.$TINA_SERVICE_NAME
		fi
		ECHONOCR "Shutting down Time Navigator ($TINA_SERVICE_NAME)..."
		if [ $OS_TYPE = "Darwin" ] ; then
			echo `date` "Stopping tina_daemon ($TINA_SERVICE_NAME) daemon" &gt;&gt; /var/log/system.log
		fi
		echo `date` "Stopping tina_daemon ($TINA_SERVICE_NAME) daemon" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
		$TINA_HOME/Bin/tina_stop &gt; /dev/null
		retval=0
		if [ $ISREDHATLIKE -eq 1 ]; then
			echo_success
			echo
		elif [ $ISSUSE -eq 1 ]; then
			rc_status -v
		else
			echo
		fi
	elif [ ! -f ${TINA_HOME}/.ndmp.sh ] ; then
		if [ $ISREDHATLIKE -eq 1 ]; then
			echo "Shutting down Time Navigator ($TINA_SERVICE_NAME)..."
			echo_failure
			echo
		elif [ $ISSUSE -eq 1 ]; then
			rc_failed 1
		else
			echo
		fi
	fi
}

RCStatus()
{
	## Check status with checkproc(8), if process is running
	## checkproc will return with exit status 0.

	# Status has a slightly different for the status command:
	# 0 - service running
	# 1 - service dead, but /var/run/ pid file exists
	# 2 - service dead, but /var/lock/ lock file exists
	# 3 - service not running

	if [ -f $TINA_HOME/Conf/hosts ] ; then
		host_to_ping=`cat $TINA_HOME/Conf/hosts | grep ^localhostname | awk '{print $2}' 2&gt;/dev/null`
		if [ $? != 0 -o -z "$host_to_ping" ] ; then
			host_to_ping="127.0.0.1"
		fi
	else
		host_to_ping="127.0.0.1"
	fi

	is_running=`$TINA_HOME/Bin/tina_ping -host $host_to_ping -language English | grep "is running"`
	if [ $# -eq 0 ] ; then
		ECHONOCR "Checking for Time Navigator ($TINA_SERVICE_NAME): "
		if [ $OS_TYPE = "Darwin" ] ; then
			echo `date` "Checking tina_daemon ($TINA_SERVICE_NAME) daemon" &gt;&gt; /var/log/system.log
		fi
		echo `date` "Checking tina_daemon ($TINA_SERVICE_NAME) daemon" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
		if [ ! -z "$is_running" ] ; then
			echo "tina_daemon is running"
			echo `date` "Checking tina_daemon ($TINA_SERVICE_NAME) daemon: tina_daemon is running" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
			retval=0
		else
			echo "tina_daemon is stopped"
			echo `date` "Checking tina_daemon ($TINA_SERVICE_NAME) daemon: tina_daemon is stopped" &gt;&gt; ${TINA_HOME}/Adm/auto_start.log
                        retval=3
		fi
	fi
}

test "$ISSUSE" -eq 1 &amp;&amp; rc_reset

case "$1" in
start)
	RCStart
	retval=0
	;;

stop)
	RCStop
	retval=0
	;;

start_msg)
	echo "Starting Time Navigator ($TINA_SERVICE_NAME)" ;;

stop_msg)
	echo "Shutting down Time Navigator ($TINA_SERVICE_NAME)" ;;

restart)
	RCStop
	sleep 3
	RCStart ;;

status)
	RCStatus ;;

*)
	echo "usage: /etc/init.d/tina {start|stop|restart|status}" ;;
esac

exit $retval</pre>
<p>One final Time Navigator configuration change must be made. The tina agent &#8220;hosts&#8221; file must be configured to set the &#8220;localhostname&#8221; of our agent to the FQDN of the floating or virtual IP address service so that the agent will only try to bind to that IP address instead of all IP addresses on the system.</p>
<pre>$ cd /cluster/tina/Conf
$ cp hosts.sample hosts
$ nano hosts</pre>
<p>Add a line to the file specifying the &#8220;localhostname&#8221; like so:</p>
<pre>localhostname myserver.company.com</pre>
<p>For this to work properly, you must also set any other tina agents running on the cluster nodes to also have a &#8220;localhostname&#8221; set in their respective &#8220;hosts&#8221; file to prevent other host-based agents from binding to all IP addresses on the host, including the virtual IP address.</p>
<p>That&#8217;s it! The tina service can be added to the HA cluster as an LSB resource agent, grouped with your storage resource agents so it will always be running on the same node as your storage.</p>
<p><strong>Conclusion</strong></p>
<p>Ok, so I rushed the end. Big deal. Sue me. I doubt anyone cares anyways!</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/05/05/atempo-time-navigator-4-2-archive-media-selection-tunable/' rel='bookmark' title='Atempo Time Navigator 4.2 Archive Media Selection Tunable'>Atempo Time Navigator 4.2 Archive Media Selection Tunable</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
<li><a href='http://techslaves.org/2010/09/08/migration-weekend-success/' rel='bookmark' title='Migration Weekend: Success'>Migration Weekend: Success</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/08/05/time-navigator-ha-cluster-agent-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cfengine 3 Snippets Part 1: DenyHosts</title>
		<link>http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/</link>
		<comments>http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/#comments</comments>
		<pubDate>Tue, 18 May 2010 22:02:09 +0000</pubDate>
		<dc:creator>rthomson</dc:creator>
				<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[cfengine]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[denyhosts]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://techslaves.org/?p=63</guid>
		<description><![CDATA[I&#8217;ve recently begun looking into configuration management with cfengine 3. I&#8217;ve ignored this growing sub-field of system administration for too long and I just can&#8217;t ignore it anymore. After spending quite some time researching the philosophies, methods and different tools out there, I settled on starting out with cfengine 3. There&#8217;s no special reason that [...]
Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/02/cfengine-3-snippets-part-2-sudo/' rel='bookmark' title='Cfengine 3 Snippets Part 2: sudo'>Cfengine 3 Snippets Part 2: sudo</a></li>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently begun looking into configuration management with <a href="http://cfengine.org">cfengine 3</a>. I&#8217;ve ignored this growing sub-field of system administration for too long and I just can&#8217;t ignore it anymore. After spending quite some time researching the philosophies, methods and different tools out there, I settled on starting out with cfengine 3. There&#8217;s no special reason that I chose cfengine instead of puppet, bcfg2, chef or AutomateIT. I haven&#8217;t used any of these tools and thus I cannot pass judgement on them or their methods. All these projects seem to have intelligent and highly motivated people behind them. I simply gravitated towards cfengine because of its strong academic background and the fact that version 3 now represents the most recent and modern research in the field by Mark Burgess et. al.</p>
<p>As part of my learning experience with cfengine, I&#8217;ve decided to start posting some of the code that I&#8217;ve begun developing in the hopes that by writing about it, I can learn better, faster and maybe even receive some helpful comments from readers along the way. Beware, I&#8217;m a cfengine newbie and so what I post here should NOT be copy and pasted into your environment unless you&#8217;re ok with the potential of wildly breaking things!</p>
<p>The first snippet of code I want to discuss is related to managing our <a href="http://denyhosts.sourceforge.net/">DenyHosts</a> configuration. As part of our &#8220;security policy&#8221;, I would like to ensure that every RedHat/CentOS system is running a properly configured DenyHosts instance. Here is what I&#8217;ve come up with so far.</p>
<p><span id="more-63"></span></p>
<pre>################################################################################
#
# FILE: denyhosts.cf
# DESC: Install, update, configure and ensure DenyHosts is running
# DATE: May 2010
#
#################################################################################

bundle agent denyhosts
{

packages:

  "denyhosts" -&gt; "Security policy"
    comment               =&gt; "Ensure denyhosts is installed once a week",
    package_policy        =&gt; "add",
    package_method        =&gt; yum,
    package_architectures =&gt; { "noarch" },
    action                =&gt; if_elapsed("10080");

  Night::

  "denyhosts" -&gt; "Security policy"
    comment               =&gt; "Check for update to denyhosts every 24 hours (and only at night)",
    package_policy        =&gt; "update",
    package_method        =&gt; yum,
    package_architectures =&gt; { "noarch" },
    action                =&gt; if_elapsed("1440");

files:

  "/etc/denyhosts.conf" -&gt; "Security policy"
    comment   =&gt; "Standard base DenyHosts configuration",
    copy_from =&gt; mycopy("$(g.confdir)/denyhosts/denyhosts.conf", "$(g.cfserver)"),
    classes   =&gt; cdefine("denyhosts_restart", "denyhosts_conf_copy_failed"),
    perms     =&gt; mo("400", "root"),
    action    =&gt; if_elapsed("1440");

processes:

  "python /usr/bin/denyhosts.py" -&gt; "Security policy"
    comment       =&gt; "Define denyhosts_restart class if denyhost is NOT running",
    restart_class =&gt; canonify("denyhosts_restart");

commands:

  "/sbin/service denyhosts restart" -&gt; "Security policy"
     comment    =&gt; "Restarting DenyHosts after configuration change or death",
     ifvarclass =&gt; canonify("denyhosts_restart");

}</pre>
<p>If you&#8217;re familiar with cfengine at all, you&#8217;ll quickly realize this is not a complete configuration. I am relying on the cfengine standard library for several body definitions as well as custom site variables defined in the common bundle named &#8220;g&#8221; (not shown). And of course, there are no control bodies, bundlesequence or many other things that make up a complete cfengine configuration, hence &#8220;snippet&#8221;.</p>
<p>Let&#8217;s ignore what&#8217;s lacking for now and focus on the meat of the promises.</p>
<h3>Packages</h3>
<p>The first part of the denyhosts bundle is dealing with packages. I&#8217;m making two promises regarding the &#8220;denyhosts&#8221; package. The first promise is that the package has been added to the system via yum and the second is that the package is up to date via yum. I&#8217;m not entirely clear on how to best manage promises like this yet so perhaps I&#8217;m missing some cute shorthand for both adding and keeping packages up to date. For now, I&#8217;ll stick with two separate promises.</p>
<p>You&#8217;ll also notice that I&#8217;m only checking to see if the package is installed once a week (via action =&gt; if_elapsed) and only checking to see if the package is up to date once every 24 hours (if_elapsed, again). The update promise is also subject to the Night class to ensure that package updates only occur at night and not during the work day. This is just a matter of preference. I&#8217;d prefer if updates occur at night, you may not.</p>
<p>Since I&#8217;m using a &#8220;smart&#8221; package manager to ensure that denyhosts is installed, I can count on having yum resolve any dependencies (such as python) for me automatically. I would loath to describe every dependency for every package I want control over by hand.</p>
<h3>Files</h3>
<p>There is only one file that I&#8217;m concerned with when it comes to denyhosts and that is the denyhosts configuration file in /etc/denyhosts.conf. Instead of doing file edits on the default denyhosts.conf file provided in the denyhosts packages that I&#8217;ve promised to install, I simply copy a pre-defined configuration from my cfengine server. This file has our site&#8217;s default denyhosts configuration all ready to go. If I needed to customize the configuration on a per-host or per-host-type basis, I could copy the base file to a temporary location then perform edits on the temp file and write out the changes to the final location of the default configuration file or simply maintain several pre-configured versions of denyhosts.conf and copy the appropriate file.</p>
<p>Also of note about files is that if the file promise must be repaired (if the file must be copied because it&#8217;s changed), I&#8217;m setting a class to be defined so that DenyHosts can be restarted. More on that later.</p>
<h3>Processes</h3>
<p>In this case, I&#8217;m only checking to see if the DenyHosts python process is running or not. If DenyHosts is running, we do nothing. If DenyHosts is not running, we define a class using the same name as the class we define if we have to copy the configuration file.</p>
<h3>Commands</h3>
<p>Finally, in the commands section we tell cfengine how and when to restart DenyHosts. If the &#8220;denyhosts_restart&#8221; class is defined, we instruct cfengine to restart DenyHosts with the &#8220;/sbin/service denyhosts restart&#8221; command. The canonify and cdefine special functions in cfengine provide a very powerful way of defining some rather complex relationships.</p>
<h3>What is Missing?</h3>
<p>Well, probably <em>a lot</em> of stuff. One obvious thing is that I&#8217;m not promising that DenyHosts is set to startup at boot time using the hosts&#8217; native init system. Of course, this shouldn&#8217;t be a big deal because cfengine will start it up if it&#8217;s not running at the next cf-agent run, but perhaps it would be nice to make that promise anyways.</p>
<p>I&#8217;m also not using many (or any!) classes to limit the scope of where (to what hosts) these promises will apply. Right now, I&#8217;m just working with a test environment so it&#8217;s easy to get away with that but I&#8217;m learning that it&#8217;s good to be as explicit at possible from the start when building promises.</p>
<p><strong>UPDATE:</strong> Ah, how could I forget.. Reporting is totally missing! I knew I was setting some of those classes for a reason. In the next installment, I&#8217;ll include the most basic of reporting functionality.</p>
<p>I think that&#8217;s all for now. Please critique my amateur use of cfengine 3 in the comments, I want to hear from you!</p>
<p>Related posts:<ol>
<li><a href='http://techslaves.org/2010/10/02/cfengine-3-snippets-part-2-sudo/' rel='bookmark' title='Cfengine 3 Snippets Part 2: sudo'>Cfengine 3 Snippets Part 2: sudo</a></li>
<li><a href='http://techslaves.org/2010/05/07/rhelcentos-nfs-and-firewalls/' rel='bookmark' title='RHEL/CentOS, NFS and Firewalls'>RHEL/CentOS, NFS and Firewalls</a></li>
<li><a href='http://techslaves.org/2010/03/29/nanorcs/' rel='bookmark' title='Nanorcs: Ultrasimplistic Configuration File Revision Control'>Nanorcs: Ultrasimplistic Configuration File Revision Control</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://techslaves.org/2010/05/18/cfengine-3-snippets-part-1-denyhosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

