<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rmveras's Weblog</title>
	<atom:link href="http://rmveras.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rmveras.wordpress.com</link>
	<description>Here comes the sun... =)</description>
	<lastBuildDate>Wed, 27 Jul 2011 13:18:58 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rmveras.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rmveras's Weblog</title>
		<link>http://rmveras.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rmveras.wordpress.com/osd.xml" title="Rmveras&#039;s Weblog" />
	<atom:link rel='hub' href='http://rmveras.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Auditoria no samba</title>
		<link>http://rmveras.wordpress.com/2008/06/27/auditoria-no-samba/</link>
		<comments>http://rmveras.wordpress.com/2008/06/27/auditoria-no-samba/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 20:45:05 +0000</pubDate>
		<dc:creator>rmveras</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[samba]]></category>

		<guid isPermaLink="false">http://rmveras.wordpress.com/2008/06/27/auditoria-no-samba/</guid>
		<description><![CDATA[As vezes precisamos saber quem apagou/renomeou/moveu tal arquivo e uma forma de saber isso é habilitando o módulo de auditoria do samba. Na seção [global] do /etc/samba/smb.conf adicione o seguinte: vfs object = audit Em seguida é preciso reiniciar o samba: /etc/init.d/samba restart Pronto, agora podemos verificar tudo que esta ocorrendo, os logs são gravados [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rmveras.wordpress.com&amp;blog=4018992&amp;post=15&amp;subd=rmveras&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As vezes precisamos saber quem apagou/renomeou/moveu tal arquivo e uma forma de saber isso é habilitando o módulo de auditoria do samba. Na seção [global] do /etc/samba/smb.conf adicione o seguinte:</p>
<p><code>vfs object = audit</code></p>
<p>Em seguida é preciso reiniciar o samba:</p>
<p><code>/etc/init.d/samba restart</code></p>
<p>Pronto, agora podemos verificar tudo que esta ocorrendo, os logs são gravados em /var/log/messages:</p>
<p><code>Jun 27 17:10:16 localhost smbd_audit[29426]: connect to service PUBLICA by user rafael<br />
Jun 27 17:10:17 localhost smbd_audit[29426]: open teste.txt (fd 28 )<br />
Jun 27 17:10:17 localhost smbd_audit[29426]: close fd 28<br />
Jun 27 17:10:27 localhost smbd_audit[29417]: opendir .<br />
Jun 27 17:10:27 localhost last message repeated 3 times<br />
Jun 27 17:10:27 localhost smbd_audit[29417]: rename ./teste.txt -&gt; ./teste2.txt<br />
Jun 27 17:10:32 localhost smbd_audit[29417]: unlink ./teste2.txt<br />
</code></p>
<p>Para ficar melhor de buscarmos e não poluir o /var/log/messages, podemos configurar o syslog para por os logs em /var/log/samba/audit.log. Abra o /etc/samba/smb/conf novamente e adicione logo abaixo da linha que adicionamos acima:</p>
<p><code>audit:facility = LOCAL1<br />
audit:priority = NOTICE<br />
</code></p>
<p>Ficando:</p>
<p><code># Auditoria<br />
vfs objects = audit<br />
audit:facility = LOCAL1<br />
audit:priority = NOTICE<br />
</code></p>
<p>E para concluir vamos configurar uma &#8220;facility&#8221; personalizada no syslog que pode ser da local0 até a local7, no caso eu utilizei a local1 (audit:facility = LOCAL1) e &#8220;level/priority&#8221; igual a notice (audit:priority = NOTICE) . A adicione (no começo ou final, tanto faz) o seguinte ao /etc/syslog.conf:</p>
<p><code># Logs para auditoria do samba<br />
local1.notice                   /var/log/samba/audit.log<br />
</code></p>
<p>Reinicie o syslog e o samba:</p>
<p><code>/etc/init.d/sysklogd restart<br />
/etc/init.d/samba restart<br />
</code></p>
<p>Verificando se deu tudo certo:</p>
<p><code># tail -f /var/log/samba/audit.log<br />
Jun 27 17:22:46 localhost smbd_audit[29574]: connect to service PUBLICA by user rafael<br />
Jun 27 17:22:46 localhost smbd_audit[29574]: opendir ./<br />
Jun 27 17:37:01 localhost smbd_audit[29574]: opendir teste2<br />
Jun 27 17:37:01 localhost smbd_audit[29574]: rmdir teste2<br />
</code></p>
<p>Tudo beleza! <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rmveras.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rmveras.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rmveras.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rmveras.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rmveras.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rmveras.wordpress.com&amp;blog=4018992&amp;post=15&amp;subd=rmveras&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rmveras.wordpress.com/2008/06/27/auditoria-no-samba/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/255ae70c7740f10c90624bf32180e167?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rmveras</media:title>
		</media:content>
	</item>
		<item>
		<title>Forçando reboot e shutdown</title>
		<link>http://rmveras.wordpress.com/2008/06/22/forcando-reboot-shutdown/</link>
		<comments>http://rmveras.wordpress.com/2008/06/22/forcando-reboot-shutdown/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 05:51:03 +0000</pubDate>
		<dc:creator>rmveras</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[sysreq]]></category>

		<guid isPermaLink="false">http://rmveras.wordpress.com/?p=3</guid>
		<description><![CDATA[As vezes nos encontramos em situações onde é preciso reiniciar o S.O após algum problema e na maioria das vezes não temos acesso físico a máquina. Para melhorar a situação os comandos shutdown, halt e reboot não funcionam nem pedindo pelo amor de Deus&#8230; ehehehe. Semana passada eu me encontrei nesta situação após um problema [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rmveras.wordpress.com&amp;blog=4018992&amp;post=3&amp;subd=rmveras&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As vezes nos encontramos em situações onde é preciso reiniciar o S.O após algum problema e na maioria das vezes não temos acesso físico a máquina. Para melhorar a situação os comandos shutdown, halt e reboot não funcionam nem pedindo pelo amor de Deus&#8230; ehehehe.  Semana passada eu me encontrei nesta situação após um problema com o sistema de arquivos, depois de tentar de tudo, só me restou forçar um reboot usando sysreq.</p>
<p><strong>O que é sysreq?</strong></p>
<p>É um conjunto de teclas &#8220;mágicas&#8221; que quando você pressionar o kernel irá responder imediatamente.</p>
<p><strong>Habilitando o sysreq</strong></p>
<p>O kernel deve ser compilado com a opção <em>CONFIG_MAGIC_SYSRQ</em> ativada (a maioria das distribuições vem com esta opção ativada).  Para habitarmos  com todas as funcionalidades digite:</p>
<p><code>echo 1 &gt; /proc/sys/kernel/sysrq</code></p>
<p>Veja a tabela de opções (em inglês):</p>
<p><em>0       &#8211; disable sysrq completely<br />
1       &#8211; enable all functions of sysrq<br />
2       &#8211; enable control of console logging level<br />
4       &#8211; enable control of keyboard (SAK, unraw)<br />
8       &#8211; enable debugging dumps of processes etc.<br />
16    &#8211; enable sync command<br />
32    &#8211; enable remount read-only<br />
64    &#8211; enable signalling of processes (term, kill, oom-kill)<br />
128 &#8211; allow reboot/poweroff<br />
256 &#8211; allow nicing of all RT tasks</em></p>
<p><strong>Forçando um shutdown/reboot</strong></p>
<p>Depois de habilitado para usarmos é simples, pressione Alt + Sys Rq + &#8220;tecla de comando&#8221; ou defindo a &#8220;tecla de comando&#8221; no arquivo <em>/proc/sysrq-trigger</em>.</p>
<p><strong>Forçando shutdown:</strong></p>
<p><code>echo o &gt; /proc/sysrq-trigger</code></p>
<p><strong>Forçando reboot:</strong></p>
<p><code>echo b &gt; /proc/sysrq-trigger</code></p>
<p>Este comando irá rebootar o sistema imediatamente sem sincronizar ou desmontar o disco.</p>
<p>Tabela de comandos (em inglês):</p>
<p><em>’b’ Will immediately reboot the system without syncing or unmounting your disks.<br />
’c’ Will perform a kexec reboot in order to take a crashdump.<br />
’d’ Shows all locks that are held.<br />
’e’ Send a SIGTERM to all processes, except for init.<br />
’f’ Will call oom_kill to kill a memory hog process.<br />
’g’ Used by kgdb on ppc and sh platforms.<br />
’h’ Will display help (actually any other key than those listed here will display help. but ’h’ is easy to remember : )<br />
’i’ Send a SIGKILL to all processes, except for init.<br />
’k’ Secure Access Key (SAK) Kills all programs on the current virtual console. NOTE: See important comments below in SAK section.<br />
’m’ Will dump current memory info to your console.<br />
’n’ Used to make RT tasks nice able<br />
’o’ Will shut your system off (if configured and supported).<br />
’p’ Will dump the current registers and flags to your console.<br />
’q’ Will dump a list of all running timers.<br />
’r’ Turns off keyboard raw mode and sets it to XLATE.<br />
’s’ Will attempt to sync all mounted filesystems.<br />
’t’ Will dump a list of current tasks and their information to your console.<br />
’u’ Will attempt to remount all mounted filesystems read only.<br />
’v’ Dumps Voyager SMP processor info to your console.<br />
’w’ Dumps tasks that are in uninterruptable (blocked) state.<br />
’x’ Used by xmon interface on ppc/powerpc platforms.<br />
’0’ ’9’ Sets the console log level, controlling which kernel messages will be printed to your console. (’0’, for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)</em></p>
<p><a title="SysReq Doc" href="http://lxr.linux.no/linux+v2.6.25.7/Documentation/sysrq.txt" target="_blank">Referência</a><a href="http://rmveras.files.wordpress.com/2008/06/documentation-sysrq.pdf"><br />
SysReq Doc<br />
</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/rmveras.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/rmveras.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/rmveras.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/rmveras.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/rmveras.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rmveras.wordpress.com&amp;blog=4018992&amp;post=3&amp;subd=rmveras&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rmveras.wordpress.com/2008/06/22/forcando-reboot-shutdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/255ae70c7740f10c90624bf32180e167?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rmveras</media:title>
		</media:content>
	</item>
	</channel>
</rss>
