<?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>Tommi&#039;s stuff &#187; rhel</title>
	<atom:link href="http://tommi.org/tag/rhel/feed/" rel="self" type="application/rss+xml" />
	<link>http://tommi.org</link>
	<description></description>
	<lastBuildDate>Wed, 11 Jan 2012 17:25:37 +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>Kickstarting RHEL 6.1 or newer, registering with subscription-manager</title>
		<link>http://tommi.org/2012/01/kickstarting-rhel-6-1-or-newer-registering-with-subscription-manager/</link>
		<comments>http://tommi.org/2012/01/kickstarting-rhel-6-1-or-newer-registering-with-subscription-manager/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 14:32:42 +0000</pubDate>
		<dc:creator>tommi</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[6]]></category>
		<category><![CDATA[6.1]]></category>
		<category><![CDATA[6.2]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[rhel6]]></category>
		<category><![CDATA[rhel61]]></category>
		<category><![CDATA[rhel62]]></category>

		<guid isPermaLink="false">http://tommi.org/?p=35</guid>
		<description><![CDATA[I&#8217;ve been spending the last few hours trying to register a Red Hat Enterprise Linux machine during kickstart. What I wanted to achieve: Kickstart Register the machine with certificate based method (subscription-manager) Install Puppet which will take care of the &#8230; <a href="http://tommi.org/2012/01/kickstarting-rhel-6-1-or-newer-registering-with-subscription-manager/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been spending the last few hours trying to register a Red Hat Enterprise Linux machine during kickstart. What I wanted to achieve:</p>
<ul>
<li><a href="http://fedoraproject.org/wiki/Anaconda/Kickstart">Kickstart</a></li>
<li>Register the machine with <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/entitlements.html#rhn-v-rhnclassic">certificate based method</a> (subscription-manager)</li>
<li>Install Puppet which will take care of the remainder of the configuration.</li>
</ul>
<h1>The really short version</h1>
<p>This all goes into your anaconda kickstart file. Replace USERNAME and PASSWORD or use activation key (haven&#8217;t tested):</p>
<pre># register
echo "registering with redhat using certificate method"
subscription-manager register --username=USERNAME --password=PASSWORD --autosubscribe

# update all the base packages from the updates repository, also important since
# yum-config-manager doesn't function until you do something with yum!
echo "updating machine"
yum -t -y -e 0 update

# add optional red hat repository needed for puppet
echo "adding optional repository"
yum-config-manager --enable rhel-6-server-optional-rpms

# install epel if we can
echo "configuring epel repository"
rpm -Uvh http://download.fedora.redhat.com/pub/epel/beta/6/x86_64/epel-release-6-5.noarch.rpm

# install puppet
echo "installing puppet"
yum -t -y -e 0 install puppet</pre>
<h1>The LONG version</h1>
<h2>Why certificate based?</h2>
<p>I haven&#8217;t confirmed yet, but hoping that the new content delivery framework &#8220;cdn.redhat.com&#8221; is a lot faster here in Iceland (currently ~200-300KBps).</p>
<h2>On with the butter! (Icelandic saying)</h2>
<p>The old way used to be:</p>
<pre>rhnreg-ks --username &lt;username&gt; --password &lt;password&gt;</pre>
<p>New way, autosubscribe tries to enable to correct subscription automatically:</p>
<pre>subscription-manager register --username=&lt;username&gt; --password=&lt;password&gt; --autosubscribe</pre>
<h2>OK Great, now I&#8217;m subscribed, on to installing puppet</h2>
<h3>First we need the epel repository to get puppet</h3>
<p>The EPEL repository contains lots of extra package for rhel including puppet.</p>
<pre>rpm -Uvh http://download.fedora.redhat.com/pub/epel/beta/6/x86_64/epel-release-6-5.noarch.rpm</pre>
<h2>On to the tricky stuff</h2>
<p>puppet is in the epel repo, check. But it requires libselinux-ruby which is in the <strong>rhel-6-server-optional-rpms</strong> repository so installing puppet without enabling it will blow up because of dependency problems.</p>
<h3>Enabling rhel-6-server-optional-rpms</h3>
<p>Old version (pre 6.1) used rhn-channel, we use the new tools. Now here is what cost me quite some time. When you run &#8220;subscription-manager register&#8221; I think that the /etc/yum.repos.d/redhat.repo is not created. Not untill you run some yum commands, so that&#8217;s why I update here but I suspect any (install/update) command will do:</p>
<pre>yum -y -e 0 update
yum-config-manager --enable rhel-6-server-optional-rpms</pre>
<h2>Finally, ready to rock and roll!</h2>
<pre>yum -y -e 0 install puppet</pre>
<h2>You should have a puppet ready on RHEL 6.1&lt;</h2>
<p><a href="http://tommi.org/wp-content/uploads/2012/01/2012-01-09-102354.jpg"><img class="alignnone size-medium wp-image-37" title="2012-01-09-102354" src="http://tommi.org/wp-content/uploads/2012/01/2012-01-09-102354-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Decided to attach a picture of the damage that problems like these do to my hairstyle! <img src='http://tommi.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftommi.org%2F2012%2F01%2Fkickstarting-rhel-6-1-or-newer-registering-with-subscription-manager%2F&amp;title=Kickstarting%20RHEL%206.1%20or%20newer%2C%20registering%20with%20subscription-manager" id="wpa2a_2"><img src="http://tommi.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://tommi.org/2012/01/kickstarting-rhel-6-1-or-newer-registering-with-subscription-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SElinux and Proliant Support Pack (PSP) on RHEL or Centos 5</title>
		<link>http://tommi.org/2010/01/selinux-and-proliant-support-pack-psp-on-rhel-or-centos-5/</link>
		<comments>http://tommi.org/2010/01/selinux-and-proliant-support-pack-psp-on-rhel-or-centos-5/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 20:01:51 +0000</pubDate>
		<dc:creator>tommi</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[proliant support pack]]></category>
		<category><![CDATA[psp]]></category>
		<category><![CDATA[red hat]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[rhel5]]></category>
		<category><![CDATA[rhel54]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://tommi.org/?p=55</guid>
		<description><![CDATA[I&#8217;ve been getting these annoying messages in the audit log, /var/log/audit/audit.log after installing the Proliant Support Pack on RHEL5. type=AVC msg=audit(1262639482.789:2027381): avc:  denied  { read write } for  pid=18916 comm=&#8221;ethtool&#8221; path=&#8221;/dev/hpilo/d0ccb5&#8243; dev=tmpfs ino=6784 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file type=AVC msg=audit(1262639482.789:2027381): avc:  denied  &#8230; <a href="http://tommi.org/2010/01/selinux-and-proliant-support-pack-psp-on-rhel-or-centos-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting these annoying messages in the audit log, /var/log/audit/audit.log after installing the Proliant Support Pack on RHEL5.</p>
<blockquote><p>type=AVC msg=audit(1262639482.789:2027381): avc:  denied  { read write } for  pid=18916 comm=&#8221;ethtool&#8221; path=&#8221;/dev/hpilo/d0ccb5&#8243; dev=tmpfs ino=6784 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:object_r:device_t:s0 tclass=chr_file<br />
type=AVC msg=audit(1262639482.789:2027381): avc:  denied  { read write } for  pid=18916 comm=&#8221;ethtool&#8221; path=&#8221;socket:[22602]&#8221; dev=sockfs ino=22602 scontext=system_u:system_r:ifconfig_t:s0 tcontext=system_u:system_r:initrc_t:s0 tclass=netlink_route_socket</p></blockquote>
<p>I don&#8217;t know what this is but <strong>I DON&#8217;T</strong> want to allow it and I don&#8217;t want to see this in the audit log anymore</p>
<p>First off 3 terms:</p>
<ul>
<li>SElinux &#8211; <strong>Security-Enhanced Linux</strong> (<strong>SELinux</strong>) is a Linux feature that provides a mechanism for supporting access control security policies, including <a title="U.S. Department of Defense" href="http://en.wikipedia.org/wiki/U.S._Department_of_Defense">U.S. Department of Defense</a> style <a title="Mandatory access control" href="http://en.wikipedia.org/wiki/Mandatory_access_control">mandatory access controls</a>, through the use of <a title="Linux Security Modules" href="http://en.wikipedia.org/wiki/Linux_Security_Modules">Linux Security Modules</a> (LSM) in the <a title="Linux kernel" href="http://en.wikipedia.org/wiki/Linux_kernel">Linux kernel</a>. (wikipedia)</li>
<li><a href="http://h18000.www1.hp.com/products/servers/management/psp/">ProLiant Support Packs</a> (PSP) represent operating system (OS) specific bundles of ProLiant optimized drivers, utilities, and management agents.</li>
<li>RHEL (Red Hat Enterprise Linux) &#8211; CentOS (Community ENTerprise Operating System, RHEL Clone)</li>
</ul>
<p>So basicly what I did to get rid of these messages is that I wrote a new module called pspignore to ignore, without allowing them. Here&#8217;s what I did:</p>
<p><strong>Make a local directory for my modules</strong></p>
<blockquote><p>mkdir -p /etc/selinux/local</p></blockquote>
<blockquote><p>cd /etc/selinux/local</p></blockquote>
<p><strong>Download my custom module which include &#8220;dontaudit&#8221; for these conditions.</strong></p>
<blockquote><p>wget http://tommi.org/static/ignorepsp.te</p></blockquote>
<p><strong>Build the module and install it</strong></p>
<blockquote><p>checkmodule -M -m -o ignorepsp.mod ignorepsp.te</p>
<p>semodule_package -o ignorepsp.pp -m ignorepsp.mod</p>
<p>semodule -i ignorepsp.pp</p></blockquote>
<p>That should be it. The main thing can be found at the bottom of ignorepsp.te:</p>
<blockquote><p>dontaudit ifconfig_t device_t:chr_file { read write };<br />
dontaudit ifconfig_t initrc_t:netlink_route_socket { read write };</p></blockquote>
<p>Hope this is helpfull.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftommi.org%2F2010%2F01%2Fselinux-and-proliant-support-pack-psp-on-rhel-or-centos-5%2F&amp;title=SElinux%20and%20Proliant%20Support%20Pack%20%28PSP%29%20on%20RHEL%20or%20Centos%205" id="wpa2a_4"><img src="http://tommi.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://tommi.org/2010/01/selinux-and-proliant-support-pack-psp-on-rhel-or-centos-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Oracle work with SELinux on Red Hat Enterprise Linux 5</title>
		<link>http://tommi.org/2008/12/making-oracle-work-with-selinux-on-red-hat-enterprise-linux-5/</link>
		<comments>http://tommi.org/2008/12/making-oracle-work-with-selinux-on-red-hat-enterprise-linux-5/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 23:15:28 +0000</pubDate>
		<dc:creator>tommi</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[instant client]]></category>
		<category><![CDATA[instantclient]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[rhel5]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://tommi.org/?p=34</guid>
		<description><![CDATA[I wanted to put up for easy reference, how to setup the Oracle Instant Client packages on a SELinux enabled Red Hat Enterprise Linux 5 machine, the documentation was created on a x86_64 machine but should work on the 32 &#8230; <a href="http://tommi.org/2008/12/making-oracle-work-with-selinux-on-red-hat-enterprise-linux-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I wanted to put up for easy reference, how to setup the Oracle Instant Client packages on a SELinux enabled Red Hat Enterprise Linux 5 machine, the documentation was created on a x86_64 machine but should work on the 32 bit version as well.</p>
<p><strong>Install packages:</strong></p>
<pre>oracle-instantclient11.1-basic-11.1.0.7.0-1.x86_64.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.x86_64.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.x86_64.rpm</pre>
<p><strong>Put the relevant libraries into the textrel_shlib_t context:</strong></p>
<pre><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">semanage fcontext -a -t textrel_shlib_t /usr/lib/oracle/11.1/client64 /lib/libnnz11.so
</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">semanage fcontext -a -t textrel_shlib_t /usr/lib/oracle/11.1/client64/lib/libclntsh.so.11.1
</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">semanage fcontext -a -t textrel_shlib_t /usr/lib/oracle/11.1/client64/lib/libsqlplus.so
</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">semanage fcontext -a -t textrel_shlib_t /usr/lib/oracle/11.1/client64/lib/libociei.so
</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">semanage fcontext -a -t textrel_shlib_t /usr/lib/oracle/11.1/client64/lib/libsqlplusic.so
</span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">restorecon -R -v /usr/lib/oracle/11.1/client64/lib/</span></pre>
<p><strong>Put the libraries into the path of the dynamic library loader</strong></p>
<pre><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">echo "export ORACLE_HOME=/usr/lib/oracle/11.1/client64" &gt; /etc/profile.d/oracle.sh

</span></pre>
<p><strong><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">Set the path to the tnsnames.ora, I like /etc/tnsnames.ora</span></strong></p>
<p><span style="font-family: Courier New,courier,monaco,monospace,sans-serif">echo &#8220;export TNS_ADMIN=/etc/tnsnames.ora&#8221; &gt;&gt; /etc/profile.d/oracle.sh</span></p>
<p>Of course you have to have a valid tnsnames.ora file available.</p>
<p>Logout and login to update your environment and voila, you should be able to run sqlplus, install perl-DBD-Oracle or php-oci8, python, whatever your flavor is..</p>
<p>Ohh, and merry christmas! <img src='http://tommi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Ftommi.org%2F2008%2F12%2Fmaking-oracle-work-with-selinux-on-red-hat-enterprise-linux-5%2F&amp;title=Making%20Oracle%20work%20with%20SELinux%20on%20Red%20Hat%20Enterprise%20Linux%205" id="wpa2a_6"><img src="http://tommi.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://tommi.org/2008/12/making-oracle-work-with-selinux-on-red-hat-enterprise-linux-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

