<?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>Fogo na Caixa dAgua &#187; Troubleshoot</title>
	<atom:link href="http://www.fogonacaixadagua.com.br/category/troubleshoot/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fogonacaixadagua.com.br</link>
	<description>http://www.fogonacaixadagua.com.br</description>
	<lastBuildDate>Tue, 20 Sep 2011 21:39:38 +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>SARG 2.3.1 erro ao compilar no Fedora 14</title>
		<link>http://www.fogonacaixadagua.com.br/2011/03/sarg-2-3-1-erro-ao-compilar-no-fedora-14/</link>
		<comments>http://www.fogonacaixadagua.com.br/2011/03/sarg-2-3-1-erro-ao-compilar-no-fedora-14/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 15:22:52 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pânico]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[sarg]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=1492</guid>
		<description><![CDATA[SARG é um gerador de relatório pro squid e é bom no que faz. Tudo vai bem no ./configure O comando make parece que vai terminar tudo certo, até que nos 45 minutos do segundo tempo: /usr/bin/ld: grepday.o: undefined reference to symbol 'exp@@GLIBC_2.0' /usr/bin/ld: note: 'exp@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2011/03/sarg-2-3-1-erro-ao-compilar-no-fedora-14/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>SARG é um gerador de relatório pro squid e é bom no que faz.</p>
<p>Tudo vai bem no</p>
<pre class="brush:shell">
./configure
</pre>
<p>O comando make parece que vai terminar tudo certo, até que nos 45 minutos do segundo tempo:</p>
<pre class="brush:text">
/usr/bin/ld: grepday.o: undefined reference to symbol 'exp@@GLIBC_2.0'
/usr/bin/ld: note: 'exp@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [sarg] Error 1
</pre>
<p>pau.</p>
<p>Pra resolver:</p>
<pre class="brush:text">
export LDFLAGS="$LDFLAGS -lm"
./configure
make
</pre>
<p>Fera!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2011/03/sarg-2-3-1-erro-ao-compilar-no-fedora-14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx como serviço do Windows</title>
		<link>http://www.fogonacaixadagua.com.br/2010/06/windows-nginx-como-servico-do-windows/</link>
		<comments>http://www.fogonacaixadagua.com.br/2010/06/windows-nginx-como-servico-do-windows/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 04:03:57 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=1465</guid>
		<description><![CDATA[Pois é. Deixando de lado toda aquela crítica e talz, é interessante saber como rodar o Nginx num servidor Windows como serviço. Por que utilizar instsrv não funciona? Porque quando se inicia o nginx ele criar 2 processos nginx e o Service do Windows ao parar o serviço vai parar apenas 1 processo, deixando o [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2010/06/windows-nginx-como-servico-do-windows/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>Pois é.</p>
<p>Deixando de lado toda aquela crítica e talz, é interessante saber como rodar o Nginx num servidor Windows como serviço.</p>
<p>Por que utilizar <tt>instsrv</tt> não funciona? Porque quando se inicia o nginx ele criar 2 processos nginx e o Service do Windows ao parar o serviço vai parar apenas 1 processo, deixando o outro pendurado e inutilizando o Service do Windows.</p>
<p>Tem um programa bastante interessante para lidar com esse tipo cenário, e óbviamente pode ser utilizado/adaptado para outras necessidades.</p>
<p>É um Wrapper para o Windows Service, chama-se <a title='Original Link: http://projectkenai.com/projects/winsw'  href="http://www.fogonacaixadagua.com.br/?nCYcUt44">Windows Service Wrapper</a> e para fazer o Download dele, acessar http://maven.dyndns.org/2/com/sun/winsw/winsw/ e baixar a última versão disponível (agora que escrevo é a 1.8), ou caso o site esteja fora, pode fazer o download por aqui <a href="http://www.virtualxp.org/downloads/winsw/winsw-1.8-bin.exe">winsw-1.8-bin.exe</a>.</p>
<h2>Instalando e configurando o Windows Service Wrapper</h2>
<p>Depois de ter feito o download do aplicativo, copie para o diretório onde instalou o nginx, geralmente é no <tt>c:\nginx</tt> e renome o arquivo <tt>winsw-1.8-bin.exe</tt> para <tt>srvnginx.exe</tt>.</p>
<p>Crie um arquivo <tt>.xml</tt>com o mesmo nome do executável, no caso <tt>srvnginx.xml</tt> e coloque o seguinte conteúdo:</p>
<pre class="brush: xml">
<service>
 <id>nginx</id>
 <name>nginx</name>
 <description>nginx</description>
 <executable>c:\nginx\nginx.exe</executable>
 <logpath>c:\nginx\</logpath>
 <logmode>roll</logmode>
 <depend></depend>
 <startargument>-p c:\nginx</startargument>
 <stopargument>-p c:\nginx -s stop</stopargument>
</service>
</pre>
<p>Certamente você deve alterar o caminho para o nginx de acordo com sua instalação.</p>
<p>Isto feito, para finalizar, execute o comando via <tt>cmd</tt></p>
<pre class="brush: plain">
c:\nginx\srvnginx.exe install
</pre>
<p>Pronto, o serviço <tt>nginx</tt> estará no Windows Service, pronto para o tradicional Stop/Start e funcionando a contento.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2010/06/windows-nginx-como-servico-do-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LibClamAV Error: cli_loaddb()</title>
		<link>http://www.fogonacaixadagua.com.br/2010/03/libclamav-error-cli_loaddb/</link>
		<comments>http://www.fogonacaixadagua.com.br/2010/03/libclamav-error-cli_loaddb/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 22:29:23 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshoot]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=1301</guid>
		<description><![CDATA[This error can happen with Linux or FreeBSD or whichever SO that ClamAV support. When you run clamscan You get this error LibClamAV Error: cli_loaddb(): No supported database files found in /var/db/clamav ERROR: Can't open file or directory ----------- SCAN SUMMARY ----------- Known viruses: 0 Engine version: 0.95.1 Scanned directories: 0 Scanned files: 0 Infected [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2010/03/libclamav-error-cli_loaddb/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>This error can happen with Linux or FreeBSD or whichever SO that ClamAV support.</p>
<p>When you run</p>
<pre class="brush:plain">clamscan</pre>
<p>You get this error</p>
<pre class="brush:plain">
LibClamAV Error: cli_loaddb(): No supported database files found in /var/db/clamav
ERROR: Can't open file or directory

----------- SCAN SUMMARY -----------
Known viruses: 0
Engine version: 0.95.1
Scanned directories: 0
Scanned files: 0
Infected files: 0
Data scanned: 0.00 MB
Data read: 0.00 MB (ratio 0.00:1)
Time: 0.001 sec (0 m 0 s)
</pre>
<p>It means that you have no database virus.</p>
<p>Just configure and run <tt>freshclam</tt>.</p>
<p>A sample freshclam.conf file:</p>
<pre class="brush:plain">
DatabaseDirectory /var/lib/clamav
UpdateLogFile /var/log/freshclam.log
LogTime yes
LogSyslog yes
PidFile /var/run/clamd/freshclam.pid
DatabaseOwner clamav
DNSDatabaseInfo current.cvd.clamav.net
DatabaseMirror db.br.clamav.net
DatabaseMirror database.clamav.net
NotifyClamd /usr/local/etc/clamd.conf
SubmitDetectionStats /usr/local/etc/clamd.conf
DetectionStatsCountry BR
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2010/03/libclamav-error-cli_loaddb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN: routes losing/disappearing after connection established</title>
		<link>http://www.fogonacaixadagua.com.br/2010/03/openvpn-routes-losing-disappearing-after-connection-established/</link>
		<comments>http://www.fogonacaixadagua.com.br/2010/03/openvpn-routes-losing-disappearing-after-connection-established/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 22:19:12 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[OpenVPN]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/2010/03/openvpn-routes-losing-disappearing-after-connection-established/</guid>
		<description><![CDATA[Symptom After you connect to your OpenVPN, even without error and you are still able to see the print that say the routes were added successfully, after about a 10 seconds, the routes simply disappear and you lose connection with your hosts/server. However, manually adding the routes, you can reach the servers and they become [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2010/03/openvpn-routes-losing-disappearing-after-connection-established/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><h2>Symptom</h2>
<p>After you connect to your OpenVPN, even without error and you are still able to see the print that say the routes were added successfully, after about a 10 seconds, the routes simply disappear and you lose connection with your hosts/server.</p>
<p>However, manually adding the routes, you can reach the servers and they become accessible.</p>
<h2>Cause</h2>
<p>This is a problem with 3G technology, I haven&#8217;t seen this behavior with ADSL or dedicated Links.</p>
<p>It&#8217;s what I call obscure problem, why this happen with 3G and 3G only? don&#8217;t no if it is regarding the technology or drivers, but we have an elegant workaround for this, as you can see below.</p>
<h2>Workaround</h2>
<p>For that situation do not occurs, add the following parameter to config file of OpenVPN, client side:</p>
<pre class="brush: plain">
route-delay 20
</pre>
<p>With that line, after you connect to OpenVPN, the client will wait 20 seconds to add the routes given by server and won&#8217;t disappear no more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2010/03/openvpn-routes-losing-disappearing-after-connection-established/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN: Rotas desaparecendo após conexão estabelecida</title>
		<link>http://www.fogonacaixadagua.com.br/2009/11/openvpn-rotas-desaparecendo-apos-conexao-estabelecida/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/11/openvpn-rotas-desaparecendo-apos-conexao-estabelecida/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 15:48:50 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[OpenVPN]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=1194</guid>
		<description><![CDATA[Sintoma Após conectar-se no servidor OpenVPN, sem erros e com o print de transferência das rotas sendo mostrado normalmente, uns 10 segundos depois, as rotas desaparecem e perde-se conexão com os servidores. No entanto, adicionando as rotas manualmente, os servidores tornam-se navegáveis novamente. Causa Isto é um problema isolado com clientes que utilizam para conectar-se [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/11/openvpn-rotas-desaparecendo-apos-conexao-estabelecida/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><h2>Sintoma</h2>
<p>Após conectar-se no servidor OpenVPN, sem erros e com o print de transferência das rotas sendo mostrado normalmente, uns 10 segundos depois, as rotas desaparecem e perde-se conexão com os servidores.</p>
<p>No entanto, adicionando as rotas manualmente, os servidores tornam-se navegáveis novamente.</p>
<h2>Causa</h2>
<p>Isto é um problema isolado com clientes que utilizam para conectar-se na internet modems USB e modems 3G (Timweb, VIVO etc).</p>
<p>Esse comportamento não ocorre com clientes que conectam-se via ADSL ou Links dedicados.</p>
<p>Portanto, é um problema obscuro, ficando &#8220;no ar&#8221; se é problema de drivers ou da tecnologia.</p>
<h2>Workaround</h2>
<p>Para que essa situação não ocorra, adicione o seguinte parâmetro no arquivo de configuração do OpenVPN no lado do cliente</p>
<pre class="brush: plain">
route-delay 20
</pre>
<p>Com essa linha, após a conexão com o servidor OpenVPN o cliente esperará 20 segundos para adicionar as rotas fornecidas pelo servidor e não mais desaparecerão.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/11/openvpn-rotas-desaparecendo-apos-conexao-estabelecida/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>FreeBSD troubleshooting Samba AD</title>
		<link>http://www.fogonacaixadagua.com.br/2009/10/freebsd-troubleshooting-samba-ad/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/10/freebsd-troubleshooting-samba-ad/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 20:47:31 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=1011</guid>
		<description><![CDATA[Ao instalar o samba via ports no FreeBSD com suporte ao AD (Active Directory) da Microsoft, pode acontecer de o samba não compilar e terminar com o seguinte erro Compiling libsmb/clikrb5.c libsmb/clikrb5.c: In function `krb5_set_real_time': libsmb/clikrb5.c:128: error: dereferencing pointer to incomplete type libsmb/clikrb5.c:129: error: dereferencing pointer to incomplete type The following command failed: cc -I. [...]]]></description>
			<content:encoded><![CDATA[<p>Ao instalar o samba via ports no FreeBSD com suporte ao AD (Active Directory) da Microsoft, pode acontecer de o samba não compilar e terminar com o seguinte erro</p>
<pre class="brush: shell; gutter: false">Compiling libsmb/clikrb5.c
libsmb/clikrb5.c: In function `krb5_set_real_time':
libsmb/clikrb5.c:128: error: dereferencing pointer to incomplete type
libsmb/clikrb5.c:129: error: dereferencing pointer to incomplete type
The following command failed:
cc -I. -I/usr/ports/net/samba3/work/samba-3.0.26a/source  -O2 -pipe
-march=prescott -D_SAMBA_BUILD_=3 -I/usr/local/include
-I/usr/ports/net/samba3/work/samba-3.0.26a/source/iniparser/src
-Iinclude -I./include  -I. -I. -I./lib/replace -I./lib/talloc
-I./tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H
-I/usr/local/include -DLDAP_DEPRECATED
-I/usr/ports/net/samba3/work/samba-3.0.26a/source/lib -D_SAMBA_BUILD_=3
-fPIC -DPIC -c libsmb/clikrb5.c -o libsmb/clikrb5.o
*** Error code 1

Stop in /usr/ports/net/samba3/work/samba-3.0.26a/source.
*** Error code 1

Stop in /usr/ports/net/samba3.
*** Error code 1

Stop in /usr/ports/net/samba3.
</pre>
<p>Para resolver isso, instale, pelo ports, o krb5</p>
<pre class="brush: shell; gutter: true">cd /usr/ports/security/krb5
make install
</pre>
<p>Em seguida, volte ao port do samba e prossiga com a instalação</p>
<pre class="brush: shell; gutter: true">cd /usr/ports/net/samba3
make clean
make KRB5_HOME=/usr/local
make install
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/10/freebsd-troubleshooting-samba-ad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SELinux is preventing access to files with the label, file_t.</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/selinux-is-preventing-access-to-files-with-the-label-file_t/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/selinux-is-preventing-access-to-files-with-the-label-file_t/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 23:46:53 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Pânico]]></category>
		<category><![CDATA[RedHat]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=719</guid>
		<description><![CDATA[O seu servidor Red Hat / CentOS não tinha SELinux habilitado, você resolve habilitar para ter maior segurança nessa máquina e repara que muitos serviços não mais executam e geram erros dizendo que não conseguem encontrar bibliotecas para seu funcionamento. Isso acontece porque o SELinux não reconhece as marcações não existentes e não libera o [...]]]></description>
			<content:encoded><![CDATA[<p>O seu servidor Red Hat / CentOS não tinha SELinux habilitado, você resolve habilitar para ter maior segurança nessa máquina e repara que muitos serviços não mais executam e geram erros dizendo que não conseguem encontrar bibliotecas para seu funcionamento.</p>
<p>Isso acontece porque o SELinux não reconhece as marcações não existentes e não libera o acesso do serviço às suas bibliotecas.</p>
<p>Verificando o log do SELinux, encontra seguidas mensagens como essa:</p>
<pre class="brush: plain; gutter: false">
Summary:

SELinux is preventing access to files with the label, file_t.

Detailed Description:

SELinux permission checks on files labeled file_t are being denied. file_t is
the context the SELinux kernel gives to files that do not have a label. This
indicates a serious labeling problem. No files on an SELinux box should ever be
labeled file_t. If you have just added a new disk drive to the system you can
relabel it using the restorecon command. Otherwise you should relabel the entire
files system.

Allowing Access:

You can execute the following command as root to relabel your computer system:
"touch /.autorelabel; reboot"
</pre>
<h3>Para resolver</h3>
<p>Teóricamente quando se ativa o SELinux pela primeira vez quando o servidor está rodando ele vai solicitar um reboot pra habilitar o SELinux e nesse reboot ele vai marcar todos os arquivos do sistema para que tenham as flags das políticas. Esse cenário também ocorre quando se adiciona um novo disco ou partição ao SO.</p>
<p>Essa marcação inicial nem sempre acontece, as vezes faltam alguns arquivos com a marcação e ao tentar executá-los esse erro no <tt>/var/log/audit/audit.log</tt> aparece.</p>
<p>Fazer como sugere a solução do <tt>audit</tt> que é executando <tt>touch /.autorelabel; reboot</tt> pode resolver e também não pode.</p>
<p>Para resolver em definitivo e forçar que todos os arquivos de um determinado diretório sejam marcados o comando abaixo vai resolver (as políticas padrões para os arquivos serão restauradas) e os arquivos serão marcados corretamente, permitindo assim ao SELinux saber como lidar com o serviço.</p>
<pre class="brush: shell; gutter: true">
restorecon -R -v /diretório
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/selinux-is-preventing-access-to-files-with-the-label-file_t/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Erro do Yum ao executar um update, como resolver</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/erro-do-yum-ao-executar-um-update-como-resolver/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/erro-do-yum-ao-executar-um-update-como-resolver/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 23:33:25 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[RedHat]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=712</guid>
		<description><![CDATA[Fazendo suas iterações com o Yum e de repente se depara com esse erro ao adicionar um repositório ou ao remover ou mesmo ao dar um yum update. filelists.xml.gz &#124; 3.8 MB 00:07 Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 229, in user_main errcode = main(args) [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/erro-do-yum-ao-executar-um-update-como-resolver/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>Fazendo suas iterações com o Yum e de repente se depara com esse erro ao adicionar um repositório ou ao remover ou mesmo ao dar um <tt>yum update</tt>.</p>
<pre class="brush: plain; gutter: false">filelists.xml.gz                                         | 3.8 MB     00:07
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 145, in main
    (result, resultmsgs) = base.buildTransaction()
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 647, in buildTransaction
    (rescode, restring) = self.resolveDeps()
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 696, in resolveDeps
    CheckDeps, checkinstalls, checkremoves, missing = self._resolveRequires(errors)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 779, in _resolveRequires
    thisneeds = self._checkInstall(txmbr)
  File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 851, in _checkInstall
    provs = self.tsInfo.getProvides(*req)
  File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 432, in getProvides
    result.update(self.getNewProvides(name, flag, version))
  File "/usr/lib/python2.4/site-packages/yum/transactioninfo.py", line 414, in getNewProvides
    for pkg, hits in self.pkgSack.getProvides(name, flag, version).iteritems():
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 300, in getProvides
    return self._computeAggregateDictResult("getProvides", name, flags, version)
  File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 470, in _computeAggregateDictResult
    sackResult = apply(method, args)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 861, in getProvides
    return self._search("provides", name, flags, version)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
    return func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 837, in _search
    for pkg in self.searchFiles(name, strict=True):
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 43, in newFunc
    return func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 586, in searchFiles
    self._sql_pkgKey2po(rep, cur, pkgs)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 470, in _sql_pkgKey2po
    pkg = self._packageByKey(repo, ob['pkgKey'])
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 413, in _packageByKey
    po = self.pc(repo, cur.fetchone())
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 68, in __init__
    self._read_db_obj(db_obj)
  File "/usr/lib/python2.4/site-packages/yum/sqlitesack.py", line 94, in _read_db_obj
    setattr(self, item, _share_data(db_obj[item]))
TypeError: unsubscriptable object
</pre>
<h3>Para resolver</h3>
<p>Pode ter ficado algum lixo ou o sqlite corrompeu por algum motivo.</p>
<pre class="brush: shell; gutter: true">yum clean all
yum update
</pre>
<p>O cache, pacotes baixados pelo <tt>yum</tt> e a base sqlite com as infomações do repositório serão apagados; e com o comando <tt>ym update</tt> essas informações serão regeradas e atualizadas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/erro-do-yum-ao-executar-um-update-como-resolver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iotop, your best friend when LED of HD stays on</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 01:38:45 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[python25]]></category>
		<category><![CDATA[RedHat]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/</guid>
		<description><![CDATA[The server is slow to hell, badly accessing remotely, a simple ls it&#8217;s enougth to take a lot of seconds running&#8230; openning a program, no way&#8230; lot of minutes, time to take a cup of coffee. You, don&#8217;t understanding what&#8217;s goin on, go get a look at the server, sometimes wishing to reset it, then, [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div></div><p>The server is slow to hell, badly accessing remotely, a simple <tt>ls</tt> it&#8217;s enougth to take a lot of seconds running&#8230; openning a program, no way&#8230; lot of minutes, time to take a cup of coffee.</p>
<p>You, don&#8217;t understanding what&#8217;s goin on, go get a look at the server, sometimes wishing to reset it, then, surprisely see that the HD LED look&#8217;s like the POWER one, but, Red&#8230;</p>
<p><span id="more-685"></span></p>
<p>In situations like that where are a lot of disk activities, come the question &#8220;What now?&#8221;, how to verify what is doing such a lot of disk access?</p>
<p>I will show you <em>how to install iotop</em> on Linux Red Hat / CentOS servers.</p>
<p>For that, there&#8217;s a very handy tool, <strong><em>iotop</em></strong>,<strong><em> </em></strong>it have a very nice CLI interface that show the I/O data. Utilize the very own values that kernel pass throught and show us in a very fancy interface :)</p>
<p><img class="aligncenter size-medium wp-image-478" title="Screenshot-root@localhost:-usr-src-iotop-0.3.1" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/Screenshot-root@localhost-usr-src-iotop-0.3.1-277x300.png" alt="Screenshot-root@localhost:-usr-src-iotop-0.3.1" width="277" height="300" /></p>
<ul>
<li><a title='Original Link: http://freshmeat.net/projects/iotop'  href="http://www.fogonacaixadagua.com.br/?8EAU5fQw" target="_blank">http://freshmeat.net/projects/iotop</a></li>
</ul>
<p>Needs to have <tt>Python >= 2.5</tt> and kernel <tt>Linux >= 2.6.20</tt> with those options enabled</p>
<ul>
<li>CONFIG_TASKSTATS</li>
<li>CONFIG_TASK_DELAY_ACCT</li>
<li>CONFIG_TASK_IO_ACCOUNTING</li>
</ul>
<h3>Pre-requisites</h3>
<ul>
<li><a href="http://www.fogonacaixadagua.com.br/2009/08/instalacao-minima-do-centos-e-redhat-5-3/">CentOS / RedHat 5.3 minimal installation</a> (Portuguese only)</li>
<li><a href="http://www.fogonacaixadagua.com.br/2009/09/how-to-compile-a-new-kernel-in-linux-centos-red-hat/">Compiling a new kernel (2.6.30.5) in Linux CentOS 5.3 / Red Hat 5.3</a></li>
</ul>
<pre class="brush: shell">wget http://guichaz.free.fr/iotop/files/iotop-0.3.1.tar.bz2
tar jxvf iotop-0.3.1.tar.bz2 -C /usr/src
cd /usr/src/iotop-0.3.1/</pre>
<p>To execute the program without installing it, just call via CLI:</p>
<pre class="brush: shell">./iotop.py</pre>
<p>In case that the following error comes:</p>
<pre class="brush: shell">Traceback (most recent call last):
  File "./iotop.py", line 8, in ?
    from iotop.ui import main
  File "/usr/src/iotop-0.3.1/iotop/ui.py", line 12, in ?
    from iotop.data import find_uids, TaskStatsNetlink, ProcessList
  File "/usr/src/iotop-0.3.1/iotop/data.py", line 12, in ?
    from iotop import ioprio, vmstat
  File "/usr/src/iotop-0.3.1/iotop/ioprio.py", line 1, in ?
    import ctypes</pre>
<p>It&#8217;s because you haven&#8217;t the <tt>python</tt> installed os it isn&#8217;t the 2.5 version. It&#8217;s necessary to install it.</p>
<h4>Installing Python 2.5 on Red Hat 5.3 / CentOS 5.3</h4>
<p>Red Hat 5 / CentOS 5 comes with python 2.4 by default. It isn&#8217;t cool to simply install the new version over the default one, instead, I&#8217;m disponibilizing here the RPMs of python 2.5 for Red Hat 5 / CentOS 5 that will be installed in his own directory <tt>/usr/bin/python25</tt>, so, the scripts that Yum and others scripts made use of python 2.4 won&#8217;t get hurt.</p>
<ul>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-2.5.1-fogonacaixadagua2.i386.rpm"> python25-2.5.1-fogonacaixadagua2.i386.rpm</a> <tt>wget http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-2.5.1-fogonacaixadagua2.i386.rpm</tt></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-devel-2.5.1-fogonacaixadagua2.i386.rpm"> python25-devel-2.5.1-fogonacaixadagua2.i386.rpm</a> <tt>wget  http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-devel-2.5.1-fogonacaixadagua2.i386.rpm</tt></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-libs-2.5.1-fogonacaixadagua2.i386.rpm"> python25-libs-2.5.1-fogonacaixadagua2.i386.rpm</a> <tt>wget  http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-libs-2.5.1-fogonacaixadagua2.i386.rpm</tt></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-test-2.5.1-fogonacaixadagua2.i386.rpm"> python25-test-2.5.1-fogonacaixadagua2.i386.rpm</a> <tt>wget  http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-test-2.5.1-fogonacaixadagua2.i386.rpm</tt></li>
</ul>
<p>The news is, always that you need to use the new version of python 2.5 you&#8217;ll have to change the interpretor <tt>PATH</tt> that call python25. It&#8217;s better than the whole system going unstable, isn&#8217;t it? ;)</p>
<h3>Executing iotop.py</h3>
<p>With <tt>python25</tt> installed, it&#8217;s time to modify the script <tt>iotop.py</tt> and change the interpreter on the first line, from:</p>
<pre class="brush: shell">#!/usr/bin/python</pre>
<p>to</p>
<pre class="brush: shell">#!/usr/bin/python25</pre>
<p>Ok, time to run the script</p>
<pre class="brush: shell">./iotop.py</pre>
<p>If any of the pre-requisites won&#8217;t be safisfied, a message like this one will show informing what is missing</p>
<pre class="brush: plain; gutter: false">Could not run iotop as some of the requirements are not met:
- Python >= 2.5 for AF_NETLINK support: Found
- Linux >= 2.6.20 with I/O accounting support (CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING): Not found</pre>
<p>Python 2.5 it&#8217;s OK, but kernel isn&#8217;t.</p>
<p>Simple, compiling kernel with those options:</p>
<p>To compile the new kernel, there&#8217;s a post here that explains it, here I&#8217;ll show you just which options to be considered, compile and install the kernel it&#8217;s with you now ;)</p>
<ul>
<li><a href="http://www.fogonacaixadagua.com.br/2009/09/compilando-um-novo-kernel-no-linux-centos-5-3-red-hat-5-3/">Compiling a new kernel (2.6.30.5) in Linux CentOS 5.3 / Red Hat 5.3</a> (Portuguese only)</li>
</ul>
<pre class="brush: plain; gutter: false">General setup  --->
...
[*] Export task/process statistics through netlink (EXPERIMENTAL)
[*]   Enable per-task delay accounting (EXPERIMENTAL)
[*]   Enable extended accounting over taskstats (EXPERIMENTAL)
[*]     Enable per-task storage I/O accounting (EXPERIMENTAL)
...</pre>
<p><img class="alignnone size-full wp-image-434" title="Screenshot-3" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/Screenshot-3.png" alt="Screenshot-3" width="402" height="77" /></p>
<h3>Kernel 2.6.30.5 (rpm) with process statistics ready to be used with iotop</h3>
<ul>
<li><a href="http://www.virtualxp.org/downloads/kernel-2.6.30.5/RPMS/i386/IOTASKS/kernel-2.6.30.5fogonacaixadagua-1.i386.rpm"> kernel-2.6.30.5fogonacaixadagua-1.i386.rpm</a> <tt>wget http://www.virtualxp.org/downloads/kernel-2.6.30.5/RPMS/i386/IOTASKS/kernel-2.6.30.5fogonacaixadagua-1.i386.rpm</tt></li>
</ul>
<p>To install</p>
<pre class="brush: shell">rpm -ivh kernel-2.6.30.5fogonacaixadagua-1.i386.rpm</pre>
<p>in case you already installed this kernel before, will need to generate again an image <tt>initrd</tt> and use the flag <tt>--force</tt> with <tt>rpm -ivh --force</tt> command.</p>
<h3>iotop running</h3>
<p><img class="aligncenter size-full wp-image-478" title="Screenshot-root@localhost:-usr-src-iotop-0.3.1" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/Screenshot-root@localhost-usr-src-iotop-0.3.1.png" alt="Screenshot-root@localhost:-usr-src-iotop-0.3.1" width="509" height="551" /></p>
<h3>Installing iotop</h3>
<p>Into the directory you extracted <tt>iotop-0.3.1</tt> run the command<br />
 <tt>./setup.py install</tt></p>
<pre class="brush: plain; gutter: true">cd /usr/src/iotop-0.3.1
./setup.py install</pre>
<p>How it was installed python 2.5, if you run <tt>/usr/bin/iotop</tt> the following error will be gracefuly show to you</p>
<pre class="brush: bash; gutter: false">Traceback (most recent call last):
File "/usr/bin/iotop", line 4, in <module>
import pkg_resources
ImportError: No module named pkg_resources</module></pre>
<p>To resolve that one, it&#8217;s quite simple, into directory where you extracted iotop, in this case <tt>/usr/src/iotop-0.3.1</tt> copy the entire directory <tt>iotop</tt> to <tt>/usr/lib/python-2.5</tt></p>
<pre class="brush: shell; gutter: true">cd /usr/src/iotop-0.3.1
cp -Rp iotop /usr/lib/python2.5/</pre>
<p>And after that, edit the file <tt>/usr/bin/iptop</tt> and modify the line of interpreter</p>
<p>from</p>
<pre class="brush: shell; gutter: true">#!/usr/bin/python</pre>
<p>to</p>
<pre class="brush: bash; gutter: true">#!/usr/bin/python25</pre>
<p>Ok, iotop running!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>iotop, amigo das horas que o LED do HD não apaga</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/iotop-amigo-das-horas-que-o-led-do-hd-nao-para-de-piscar/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/iotop-amigo-das-horas-que-o-led-do-hd-nao-para-de-piscar/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 22:35:38 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pânico]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[python25]]></category>
		<category><![CDATA[RedHat]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=422</guid>
		<description><![CDATA[Servidor lento, mal acessando remotamente, um simples ls é o suficiente pra levar vários segundos executando&#8230; abrir um programa então, nem pensar&#8230; vários minutos, o tempo para acender um cigar ou tomar um café. Você, não entendendo o que se passa, vai dar uma olhada no servidor, as vezes já com a intenção de resetar, [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/iotop-amigo-das-horas-que-o-led-do-hd-nao-para-de-piscar/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.fogonacaixadagua.com.br/2009/09/iotop-amigo-das-horas-que-o-led-do-hd-nao-para-de-piscar/&amp;layout=box_count&amp;show_faces=true&amp;width=&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px !important; height:65px;" allowTransparency="true"></iframe></div></div><p>Servidor lento, mal acessando remotamente, um simples <tt>ls</tt> é o suficiente pra levar vários segundos executando&#8230; abrir um programa então, nem pensar&#8230; vários minutos, o tempo para acender um cigar ou tomar um café.</p>
<p>Você, não entendendo o que se passa, vai dar uma olhada no servidor, as vezes já com a intenção de <em>resetar</em>, e repara que o LED do HD parece com a luz do Power, mas, vermelha&#8230;</p>
<p>E pensa: <em>Ops, tem algo errado!</em></p>
<p>The english version is here</p>
<ul>
<li><a href="http://www.fogonacaixadagua.com.br/2009/09/iotop-your-best-friend-when-led-of-hd-stays-on/">iotop, your best friend when LED of HD stays on</a></li>
</ul>
<p><span id="more-422"></span></p>
<p>Em situações como essas onde há uma intensa atividade de disco, vêm uma pergunta sórdida &#8220;E agora José?&#8221;, como identificar o que está acessando tanto o disco?</p>
<p>Existem ferramentas próprias para isso, como o <tt>iostat</tt> e o <tt>vmstat</tt> colunas <tt>bi</tt> e <tt>bo</tt>.</p>
<p>Iostat é uma ferramenta que é uma mão na roda para casos assim mas a interpretação dos valores e forma diposta na tela não é da mais amigável.</p>
<p>Para isso, existe uma ferramenta, o iotop, que faz um interface muito bacana dos dados de I/O. Utiliza os próprios valores que o kernel passa e apresenta de forma bastante elegante.</p>
<p><img class="aligncenter size-full wp-image-423" title="iotop_small" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/iotop_small.png" alt="iotop_small" width="331" height="218" /></p>
<ul>
<li><a title='Original Link: http://freshmeat.net/projects/iotop'  href="http://www.fogonacaixadagua.com.br/?8EAU5fQw" target="_blank">http://freshmeat.net/projects/iotop</a></li>
</ul>
<p>Precisa ter o <tt>Python &gt;= 2.5</tt> e o kernel do <tt>Linux &gt;= 2.6.20</tt> com as opções habilitadas</p>
<ul>
<li>CONFIG_TASKSTATS</li>
<li>CONFIG_TASK_DELAY_ACCT</li>
<li>CONFIG_TASK_IO_ACCOUNTING</li>
</ul>
<h3>Pré-requisitos</h3>
<ul>
<li><a href="http://www.fogonacaixadagua.com.br/2009/08/instalacao-minima-do-centos-e-redhat-5-3/">Instalação mínima do CentOS e RedHat 5.3</a></li>
<li><a href="http://www.fogonacaixadagua.com.br/2009/09/compilando-um-novo-kernel-no-linux-centos-5-3-red-hat-5-3/">Compilando um novo kernel (2.6.30.5) no Linux CentOS 5.3 / Red Hat 5.3</a></li>
</ul>
<pre class="brush: shell">wget http://guichaz.free.fr/iotop/files/iotop-0.3.1.tar.bz2
tar jxvf iotop-0.3.1.tar.bz2 -C /usr/src
cd /usr/src/iotop-0.3.1/</pre>
<p>Para executar o programa sem instalar, é só chamar via linha de comando:</p>
<pre class="brush: shell">./iotop.py</pre>
<p>Caso o seguinte erro aconteça:</p>
<pre class="brush: shell">Traceback (most recent call last):
  File "./iotop.py", line 8, in ?
    from iotop.ui import main
  File "/usr/src/iotop-0.3.1/iotop/ui.py", line 12, in ?
    from iotop.data import find_uids, TaskStatsNetlink, ProcessList
  File "/usr/src/iotop-0.3.1/iotop/data.py", line 12, in ?
    from iotop import ioprio, vmstat
  File "/usr/src/iotop-0.3.1/iotop/ioprio.py", line 1, in ?
    import ctypes</pre>
<p>É por que você não possui o <tt>python</tt> instalado ou não é a versão 2.5 que é a recomendável, será necessário instalá-lo.</p>
<h4>Instalando o Python 2.5 no Red Hat 5.3 / CentOS 5.3</h4>
<p>O Red Hat 5 / CentOS 5 vêm com o python 2.4 por padrão. Não é legal simplesmente instalar em cima uma nova versão do python, ao invés disso, estou disponibilizando aqui os RPMs do Python 2.5 para o Red Hat 5 / CentOS 5 que será instalado num diretório próprio, em <tt>/usr/bin/python25</tt>, assim os scripts que o Yum e outros scripts utilizam o python 2.4 não serão prejudicados.</p>
<ul>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-2.5.1-fogonacaixadagua2.i386.rpm"> python25-2.5.1-fogonacaixadagua2.i386.rpm</a></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-devel-2.5.1-fogonacaixadagua2.i386.rpm"> python25-devel-2.5.1-fogonacaixadagua2.i386.rpm</a></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-libs-2.5.1-fogonacaixadagua2.i386.rpm"> python25-libs-2.5.1-fogonacaixadagua2.i386.rpm</a></li>
<li><a href="http://www.virtualxp.org/downloads/python25/RPMS/i386/python25-test-2.5.1-fogonacaixadagua2.i386.rpm"> python25-test-2.5.1-fogonacaixadagua2.i386.rpm</a></li>
</ul>
<p>A notícia é que sempre que você precisar utilizar a nova versão do python 2.5 terá que alterar o <tt>PATH</tt> que chama o interpretador. Antes isso, que todo o sistema instável, né?</p>
<p>Se você usa a versão 64bits do Red Hat 5.3 ou CentOS 5.3 (x64), então, você deve baixar o RPM Source do python25 aqui <a href="http://www.virtualxp.org/downloads/python25/python25-2.5.1-fogonacaixadagua2.src.rpm"> python25-2.5.1-fogonacaixadagua2.src.rpm</a> e compilar para que seja compatível com a versão 64 bits.</p>
<p>Pra fazer é simples. Instale o source e compile com o <tt>rpmbuild</tt></p>
<pre class="brush: shell">rpm -ivh python25-2.5.1-fogonacaixadagua2.src.rpm
rpmbuild -bb /usr/src/redhat/SPECS/python.spec</pre>
<p>Os binários serão gerados no diretório <tt>/usr/src/redhat/RPMS</tt> e proceda com a instalação normal de um rpm, utilizando o comando <tt>rpm -ivh</tt> ou pelo <tt>yum</tt>.</p>
<h3>Executando o iotop.py</h3>
<p>Com o <tt>python25</tt> instalado, é hora de modificar o script <tt>iotop.py</tt> e alterar o caminho do interpretador na primeira linha, que passa de</p>
<pre class="brush: shell">#!/usr/bin/python</pre>
<p>para</p>
<pre class="brush: shell">#!/usr/bin/python25</pre>
<p>Ok, hora de executar o script</p>
<pre class="brush: shell">./iotop.py</pre>
<p>Se algum dos pré-requisitos não forem satisfeitos, uma mensagem como essa irá pipocar na tela informando o que falta.</p>
<pre class="brush: plain; gutter: false">Could not run iotop as some of the requirements are not met:
- Python &gt;= 2.5 for AF_NETLINK support: Found
- Linux &gt;= 2.6.20 with I/O accounting support (CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT, CONFIG_TASK_IO_ACCOUNTING): Not found</pre>
<p>Python 2.5 está OK, mas o kernel não está.</p>
<p>Simples, compilar o kernel com essa opções.</p>
<p>Para compilar um novo kernel, existe um post aqui nesse site que explica isso, aqui só mostrarei onde estão as opções a serem consideradas, compilar e instalar o kernel é com você agora ;)</p>
<ul>
<li><a href="http://www.fogonacaixadagua.com.br/2009/09/compilando-um-novo-kernel-no-linux-centos-5-3-red-hat-5-3/">Compilando um novo kernel (2.6.30.5) no Linux CentOS 5.3 / Red Hat 5.3</a></li>
</ul>
<pre class="brush: plain; gutter: false">General setup  ---&gt;
...
[*] Export task/process statistics through netlink (EXPERIMENTAL)
[*]   Enable per-task delay accounting (EXPERIMENTAL)
[*]   Enable extended accounting over taskstats (EXPERIMENTAL)
[*]     Enable per-task storage I/O accounting (EXPERIMENTAL)
...</pre>
<p><img class="alignnone size-full wp-image-434" title="Screenshot-3" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/Screenshot-3.png" alt="Screenshot-3" width="402" height="77" /></p>
<h3>Kernel 2.6.30.5 (rpm) com suporte à estatísticas dos processos e pronto para ser usado com o iotop</h3>
<ul>
<li><a href="http://www.virtualxp.org/downloads/kernel-2.6.30.5/RPMS/i386/IOTASKS/kernel-2.6.30.5fogonacaixadagua-1.i386.rpm"> kernel-2.6.30.5fogonacaixadagua-1.i386.rpm</a></li>
</ul>
<p>Pra instalar</p>
<pre class="brush: shell">rpm -ivh kernel-2.6.30.5fogonacaixadagua-1.i386.rpm</pre>
<p>e caso você já tenha instalado esse kernel, deverá gerar a imagem <tt>initrd</tt> novamente e utilizar a flag <tt>--force</tt> no comando <tt>rpm -ivh --force</tt>.</p>
<h3>iotop em funcionamento</h3>
<p><img class="aligncenter size-full wp-image-478" title="Screenshot-root@localhost:-usr-src-iotop-0.3.1" src="http://www.fogonacaixadagua.com.br/wp-content/uploads/2009/09/Screenshot-root@localhost-usr-src-iotop-0.3.1.png" alt="Screenshot-root@localhost:-usr-src-iotop-0.3.1" width="509" height="551" /></p>
<h3>Instalando o iotop</h3>
<p>Entre no diretório onde descompactou o <tt>iotop-0.3.1</tt> e execute o comando <tt>./setup.py install</tt></p>
<pre class="brush: plain; gutter: true">cd /usr/src/iotop-0.3.1
./setup.py install</pre>
<p>Como foi instalada a versão 2.5 do Python, se você tentar executar o comando <tt>/usr/bin/iotop</tt> será agraciado com o seguinte erro</p>
<pre class="brush: bash; gutter: false">Traceback (most recent call last):
File "/usr/bin/iotop", line 4, in &lt;module&gt;
import pkg_resources
ImportError: No module named pkg_resources</pre>
<p>Pra resolver esse impasse, é bem simples, no diretório onde foi descompactado o iotop, no caso <tt>/usr/src/iotop-0.3.1</tt> copie o diretório <tt>iotop</tt> para <tt>/usr/lib/python-2.5</tt></p>
<pre class="brush: shell; gutter: true">cd /usr/src/iotop-0.3.1
cp -Rp iotop /usr/lib/python2.5/</pre>
<p>E por fim, edite o arquivo <tt>/usr/bin/iotop</tt> e altere a linha do interpretador</p>
<p>de</p>
<pre class="brush: shell; gutter: true">#!/usr/bin/python</pre>
<p>para</p>
<pre class="brush: bash; gutter: true">#!/usr/bin/python25</pre>
<p>Ok, iotop instalado.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/iotop-amigo-das-horas-que-o-led-do-hd-nao-para-de-piscar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD: (squid), uid 100: exited on signal 6 (core dumped)</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/freebsd-squid-uid-100-exited-on-signal-6-core-dumped/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/freebsd-squid-uid-100-exited-on-signal-6-core-dumped/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:34:43 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=388</guid>
		<description><![CDATA[O SQUID no FreeBSD 6.x e 7.x, versão 2.6.x e 2.7.x começaram a apresentar um erro estranho, não era problema de hardware. O serviço &#8216;morria&#8216; com sinal 6. pid 99376 (squid), uid 100: exited on signal 6 (core dumped) pid 7499 (squid), uid 100: exited on signal 6 (core dumped) pid 7508 (squid), uid 100: [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/freebsd-squid-uid-100-exited-on-signal-6-core-dumped/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.fogonacaixadagua.com.br/2009/09/freebsd-squid-uid-100-exited-on-signal-6-core-dumped/&amp;layout=box_count&amp;show_faces=true&amp;width=&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px !important; height:65px;" allowTransparency="true"></iframe></div></div><p>O SQUID no FreeBSD 6.x e 7.x, versão 2.6.x e 2.7.x começaram a apresentar um erro estranho, não era problema de hardware. O serviço &#8216;<em>morria</em>&#8216; com sinal 6.</p>
<pre class="brush: plain; gutter: false">
pid 99376 (squid), uid 100: exited on signal 6 (core dumped)
pid 7499 (squid), uid 100: exited on signal 6 (core dumped)
pid 7508 (squid), uid 100: exited on signal 6 (core dumped)
pid 7517 (squid), uid 100: exited on signal 6 (core dumped)
pid 7561 (squid), uid 100: exited on signal 6 (core dumped)
pid 7570 (squid), uid 100: exited on signal 6 (core dumped)
pid 7581 (squid), uid 100: exited on signal 6 (core dumped)
pid 7592 (squid), uid 100: exited on signal 6 (core dumped)
pid 7612 (squid), uid 100: exited on signal 6 (core dumped)
pid 7621 (squid), uid 100: exited on signal 6 (core dumped)
pid 7630 (squid), uid 100: exited on signal 6 (core dumped)
pid 7674 (squid), uid 100: exited on signal 6 (core dumped)
pid 7683 (squid), uid 100: exited on signal 6 (core dumped)
</pre>
<p>Para resolver, editar o arquivo <tt>/boot/loader.conf</tt> e acrescentar os seguintes parâmetros: </p>
<pre class="brush: plain; gutter: true">
kern.ipc.msgmnb=8192
kern.ipc.msgmni=40
kern.ipc.msgseg=512
kern.ipc.msgssz=64
kern.ipc.msgtql=2048
</pre>
<p>Será necessário um <tt>reboot</tt> no servidor para que as configurações tenha efeito.</p>
<p>Após a adição desses parâmetros o SQUID não mais apresentou falhas de segmentação</p>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/freebsd-squid-uid-100-exited-on-signal-6-core-dumped/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Xen HVM não encontrando devices</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/xen-hvm-nao-encontrando-devices/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/xen-hvm-nao-encontrando-devices/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:29:20 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Pânico]]></category>
		<category><![CDATA[Troubleshoot]]></category>
		<category><![CDATA[Virtualização]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=384</guid>
		<description><![CDATA[Na primeira semana, a máquina virtual, que é um Windows 2003, funcionou normalmente, sem apresentar problemas. Foi necessário um reboot&#8230; Esse foi o começo da história, a VM ficou fora por mais de 4 horas seguidas até eu descobrir o que se passava. Horas em busca de informações e apenas essa msg de erro no [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/xen-hvm-nao-encontrando-devices/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.fogonacaixadagua.com.br/2009/09/xen-hvm-nao-encontrando-devices/&amp;layout=box_count&amp;show_faces=true&amp;width=&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px !important; height:65px;" allowTransparency="true"></iframe></div></div><p>Na primeira semana, a máquina virtual, que é um Windows 2003, funcionou normalmente, sem apresentar problemas.</p>
<p>Foi necessário um reboot&#8230;</p>
<p><span id="more-384"></span></p>
<p>Esse foi o começo da história, a VM ficou fora por mais de 4 horas seguidas até eu descobrir o que se passava.</p>
<p>Horas em busca de informações e apenas essa msg de erro no log era apresentado cheguei quase a recriar a máquina apartir de uma imagem que possuia.</p>
<p>Ao tentar subir uma VM HVM no Xen, o processo é abortado e não tem início o boot da VM.</p>
<p>A Mensagem que aparece nos logs parece-se com uma dessas:</p>
<pre class="brush: plain; gutter: false">[xend 4741] DEBUG (blkif:27) exception looking up device number for hda: [Errno 2] No such file or directory: '/dev/hda'</pre>
<p>ou</p>
<pre class="brush: plain; gutter: false">[xend 4741] DEBUG (blkif:27) exception looking up device number for hda: [Errno 2] No such file or directory: '/dev/Xxx'</pre>
<h4>Resolução do problema</h4>
<p>Ativando a flag acpi e desabilitando a apic e pae resolvem o problema.</p>
<pre class="brush: plain; gutter: true">pae=0
acpi=1
apic=0
</pre>
<p>Ao final, o arquivo de configuração da VM parece-se com o seguinte:</p>
<pre class="brush: plain; gutter: true; highlight: [17,18,19]">
import os, re
arch = os.uname()[4]
if re.search('64', arch):
    arch_libdir = 'lib64'
else:
    arch_libdir = 'lib'

kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'

memory = 3096
shadow_memory = 8

name = "021app501"
vcpus=2

pae=0
acpi=1
apic=0

vif = [ 'bridge=xenbr0' ]
disk = [ 'phy:/dev/vm/xyz-disk,ioemu:hda,w', 'phy:/dev/vm/xyz-disk-d,ioemu:hdb,w', 'phy:/dev/vm/xyz-disk-e,ioemu:hdc,w' ]

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
boot="c"

sdl=0
vnc=1
vnclisten="0.0.0.0"
vncdisplay=1
vncpasswd=''
stdvga=0
serial='pty'
usbdevice='tablet'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/xen-hvm-nao-encontrando-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erro ao compilar modulo ssh2 para PHP</title>
		<link>http://www.fogonacaixadagua.com.br/2009/09/erro-ao-compilar-modulo-ssh2-para-php/</link>
		<comments>http://www.fogonacaixadagua.com.br/2009/09/erro-ao-compilar-modulo-ssh2-para-php/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:18:15 +0000</pubDate>
		<dc:creator>Daniel Kühl Lima</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshoot]]></category>

		<guid isPermaLink="false">http://www.fogonacaixadagua.com.br/?p=378</guid>
		<description><![CDATA[Nota Para compilar a extensão ssh2 para o php é necessário ter o programa phpize, ele está no pacote php-devel*.rpm Ao compilar a extensão ssh2 para o php, um erro ocorre: gcc -I. -I/usr/src/ssh2-0.10 -DPHP_ATOM_INC -I/usr/src/ssh2-0.10/include -I/usr/src/ssh2-0.10/main -I/usr/src/ssh2-0.10 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/src/ssh2-0.10/ssh2.c -fPIC -DPIC -o .libs/ssh2.o /usr/src/ssh2-0.10/ssh2.c: In [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-vertical"><script type="text/javascript">
			<!-- 
				tweetmeme_url = "http://www.fogonacaixadagua.com.br/2009/09/erro-ao-compilar-modulo-ssh2-para-php/";
				tweetmeme_source = "tweetmeme";
				tweetmeme_style = "normal";
				
			//-->
			</script>
                        <script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div><div class="socialize-in-button socialize-in-button-vertical"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.fogonacaixadagua.com.br/2009/09/erro-ao-compilar-modulo-ssh2-para-php/&amp;layout=box_count&amp;show_faces=true&amp;width=&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px !important; height:65px;" allowTransparency="true"></iframe></div></div><div style="border: medium none ; margin: 1em 5em; padding: 0.2em; background-color: #bbffbb;">
<div style="float: left;"><img src="/images/Info.png" alt="" width="32" height="32" /></div>
<div style="margin-left: 36px;"><strong>Nota</strong><br />
Para compilar a extensão ssh2 para o php é necessário ter o programa <strong>phpize</strong>, ele está no pacote php-devel*.rpm</div>
</div>
<p>Ao compilar a extensão ssh2 para o php, um erro ocorre:</p>
<pre class="brush: plain; gutter: false">
gcc -I. -I/usr/src/ssh2-0.10 -DPHP_ATOM_INC -I/usr/src/ssh2-0.10/include -I/usr/src/ssh2-0.10/main -I/usr/src/ssh2-0.10 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/src/ssh2-0.10/ssh2.c  -fPIC -DPIC -o .libs/ssh2.o
/usr/src/ssh2-0.10/ssh2.c: In function 'zif_ssh2_methods_negotiated':
/usr/src/ssh2-0.10/ssh2.c:481: warning: passing argument 2 of 'libssh2_session_methods' makes integer from pointer without a cast
/usr/src/ssh2-0.10/ssh2.c:481: error: too many arguments to function 'libssh2_session_methods'
/usr/src/ssh2-0.10/ssh2.c: In function 'zif_ssh2_fingerprint':
/usr/src/ssh2-0.10/ssh2.c:536: warning: assignment discards qualifiers from pointer target type
/usr/src/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_add':
/usr/src/ssh2-0.10/ssh2.c:1038: warning: passing argument 1 of '_efree' discards qualifiers from pointer target type
/usr/src/ssh2-0.10/ssh2.c: In function 'zif_ssh2_publickey_list':
/usr/src/ssh2-0.10/ssh2.c:1097: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/src/ssh2-0.10/ssh2.c:1098: warning: passing argument 4 of 'add_assoc_stringl_ex' discards qualifiers from pointer target type
/usr/src/ssh2-0.10/ssh2.c:1106: warning: initialization discards qualifiers from pointer target type
/usr/src/ssh2-0.10/ssh2.c:1107: warning: passing argument 2 of '_zend_hash_add_or_update' discards qualifiers from pointer target type
make: *** [ssh2.lo] Error 1
</pre>
<p>Pra resolver isso, editar o arquivo <strong>config.h</strong> e acrescentar:</p>
<pre class="brush: plain; gutter: true">
#define LIBSSH2_APINO 200412301450
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.fogonacaixadagua.com.br/2009/09/erro-ao-compilar-modulo-ssh2-para-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

