<?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>Matejunkie &#187; reisub</title>
	<atom:link href="http://www.matejunkie.com/tag/reisub/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.matejunkie.com</link>
	<description>&#34;Look behind you, a Three-Headed Monkey!&#34;</description>
	<lastBuildDate>Thu, 07 Jan 2010 14:26:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Magic SysRq &#8211; REISUB</title>
		<link>http://www.matejunkie.com/magic-sysrq-reisub/</link>
		<comments>http://www.matejunkie.com/magic-sysrq-reisub/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 03:40:35 +0000</pubDate>
		<dc:creator>Mike Adolphs</dc:creator>
				<category><![CDATA[Binary Talks]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[magic sysrq]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[reisub]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://www.matejunkie.net//?p=697</guid>
		<description><![CDATA[Ever encoutered a frozen X-Server without the possibility to switch to another console or a rare, but nasty kernel panic? Probably and I guess the majority of the people hit the power button in those cases risking data loss. This is not necessary. There are other ways to restart a frozen Linux system! The kernel [...]]]></description>
			<content:encoded><![CDATA[<p>Ever encoutered a frozen X-Server without the possibility to switch to another console or a rare, but nasty kernel panic? Probably and I guess the majority of the people hit the power button in those cases risking data loss.</p>
<p>This is not necessary. There are other ways to restart a frozen Linux system!</p>
<p>The kernel has a feature called &#8220;<a title="Linux Kernel documentation" href="http://www.mjmwired.net/kernel/Documentation/sysrq.txt" target="_blank">Magic System Request Keys</a>&#8221; &#8211; if it was compiled with the CONFIG_MAGIC_SYSRQ option though. It is available via ALT+PRINT on most systems and provides various low level commands to safely turn of or reboot your computer in case of a failure.</p>
<p>If you want to know whether this feature is available on your machine, ask /proc for it. If it returns a 1 Magic SysRq is active, a 0 indicates that it&#8217;s not.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>sysrq
<span style="color: #000000;">1</span></pre></div></div>

<p>Hold down ALT+PRINT and type slowly REISUB to restart your system. Hold down ALT+PRINT and type REISUO to turn it off.</p>
<p>A short note on what REISUB or REISUO does:</p>
<ol>
<li><strong>R</strong> &#8211; Switches the keyboard from raw to XLATE mode (detatching from the X-Server)</li>
<li><strong>E</strong> &#8211; Sending a SIGTERM to all processes except INIT</li>
<li><strong>I</strong> &#8211; Sending a SIGKILL to all processes except INIT (and that&#8217;s why to type REISUB slowly)</li>
<li><strong>S</strong> &#8211; Syncs all data in the cache to mounted partitions</li>
<li><strong>U</strong> &#8211; Unmounts all mounted partitions and remounts them read-only</li>
<li><strong>B</strong> &#8211; Reboot the system immediately without unmounting or syncing mounted partitions<br />
<strong>or</strong><br />
<strong>O</strong> &#8211; Shut down the system immediately without unmounting or syncing mounted partitions</li>
</ol>
<p>Be aware of the fact that the feature is currently broken in Ubuntu 8.10 because of a problem regarding kbd, evdev and 8.10&#8242;s xserver version. It only works from a text console, therefore not on the X-Server.<br />
It is possible to reconfigure the xorg.conf from kbd to evdev like in the following, but no guarantees:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Section <span style="color: #ff0000;">&quot;InputDevice&quot;</span>
	Identifier	<span style="color: #ff0000;">&quot;Generic Keyboard&quot;</span>
	Driver		<span style="color: #ff0000;">&quot;kbd&quot;</span>
	Option		<span style="color: #ff0000;">&quot;XkbRules&quot;</span>	<span style="color: #ff0000;">&quot;xorg&quot;</span>
	Option		<span style="color: #ff0000;">&quot;XkbModel&quot;</span>	<span style="color: #ff0000;">&quot;pc105&quot;</span>
	Option		<span style="color: #ff0000;">&quot;XkbLayout&quot;</span>	<span style="color: #ff0000;">&quot;de&quot;</span>
EndSection</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Section <span style="color: #ff0000;">&quot;ServerLayout&quot;</span>
        ...
	InputDevice	<span style="color: #ff0000;">&quot;Generic Keyboard&quot;</span>
	Option		<span style="color: #ff0000;">&quot;AutoAddDevices&quot;</span>	<span style="color: #ff0000;">&quot;false&quot;</span>
EndSection</pre></div></div>

<p>It&#8217;ll be fixed in 9.04 coming this April as stated in the <a title="Launchpad Ubuntu - Bug #305762" href="https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/305762" target="_blank">bug description</a> on Launchpad.</p>
<p>One last hint: If your machine doesn&#8217;t have a PRINT/SysRq key and you&#8217;re still able to access the console, yu may also send the commands via echo to the sysrq-trigger as seen in the example below:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">user<span style="color: #000000; font-weight: bold;">@</span>server:~$ <span style="color: #7a0874; font-weight: bold;">echo</span> r <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tee</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/</span>sysrq-trigger</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.matejunkie.com/magic-sysrq-reisub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
