<?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>Mithro rants about stuff &#187; power</title>
	<atom:link href="http://blog.mithis.net/archives/tag/power/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.mithis.net</link>
	<description></description>
	<lastBuildDate>Fri, 16 Dec 2011 06:02:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WTF power scripts went in Intrepid&#8230;.</title>
		<link>http://blog.mithis.net/archives/uncategorized/92-power-scripts-in-intrepid</link>
		<comments>http://blog.mithis.net/archives/uncategorized/92-power-scripts-in-intrepid#comments</comments>
		<pubDate>Mon, 19 Jan 2009 05:42:19 +0000</pubDate>
		<dc:creator>mithro</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[acpi]]></category>
		<category><![CDATA[hal]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[resume]]></category>
		<category><![CDATA[scripts]]></category>
		<category><![CDATA[suspend]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.mithis.net/?p=92</guid>
		<description><![CDATA[On previous versions of Ubuntu, the scripts which are called after a resume from suspend have been found in /etc/acpi/resume.d directory. I used this functionality to turn off some of the hardware in my Vaio which I don&#8217;t use (such as the bluetooth and the cdrom drive). This stopped working when I upgraded to Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>On previous versions of <a href="http://www.ubuntu.com/">Ubuntu</a>, the scripts which are called after a resume from suspend have been found in <i>/etc/acpi/resume.d</i> directory. I used this functionality to turn off some of the hardware in my Vaio which I don&#8217;t use (such as the bluetooth and the cdrom drive). </p>
<p>This stopped working when I upgraded to Ubuntu Intrepid. Even more strangely while the scripts are still installed, even they are never called.</p>
<p>It appears that thanks to moving towards <a href="http://www.freedesktop.org/wiki/Software/hal">HAL</a> (which is probably a &#8220;Good Thing&#8221;) these scripts are no longer used. The scripts which are used can be found in <i>/etc/pm/</i>. Not only has the location changed, but the script format has too.</p>
<p>Previously, my script was found in <i>/etc/acpi/resume.d/99-custom.sh</i> looked like the following,</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #666666; font-style: italic;"># Turn off the CD drive and the bluetooth device</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>cdpower
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>cdpower
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>bluetoothpower
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>bluetoothpower</pre></div></div>

</blockquote>
<p>Now my script script must be found in <i>/etc/pm/sleep.d/10-custom</i> and looks like the following,</p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh -e</span>
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
	resume<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #666666; font-style: italic;"># Turn off the CD drive and the bluetooth device</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>cdpower
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>cdpower
&nbsp;
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>bluetoothpower
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>platform<span style="color: #000000; font-weight: bold;">/</span>sony-laptop<span style="color: #000000; font-weight: bold;">/</span>bluetoothpower
	<span style="color: #000000; font-weight: bold;">;;</span>
<span style="color: #000000; font-weight: bold;">esac</span></pre></div></div>

</blockquote>
<p>The main reason I&#8217;m posting this on my blog is that this change does <b>not seem to be documented anywhere</b>. Searching on Google for things like &#8220;resume script intrepid&#8221; or &#8220;/etc/acpi/resume.d intrepid&#8221; does not come up with anything useful. Hopefully some people will find this helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mithis.net/archives/uncategorized/92-power-scripts-in-intrepid/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

