[ltp] A new udev rule gives me 3min startup delay

Daniel Castro linux-thinkpad@linux-thinkpad.org
Wed, 26 Aug 2009 10:11:42 +0100


--0015175cff0ce16f01047207d6e4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2009/8/26 Henrique de Moraes Holschuh <hmh@hmh.eng.br>

> On Tue, 25 Aug 2009, Daniel Castro wrote:
> > It work fine, it catches the event and does what I want to do. BUT, for
> some
> > reason during startup it's creating a huge delay, like 3 minutes. As soon
> as
> > I move the file /etc/udev/rules.d/80-thinkpad-T61.rules out of that
> folder
> > startup times go back to normal.
> >
> > Any ideas or pointers?
>
> If you need to run it only on changes (i.e. dock/undock), key it on the
> action "change" and not all actions (such as "add" and "remove") like you
> seem to be doing by not keying to an action at all...
>
> "udevadm monitor" can help you see the different actions.  Ask it to show
> the full environment.

Not sure I understand right...

udevadm monitor shows me:

When I undock:
KERNEL[1251276441.337003] change   /devices/platform/dock.0 (platform)
UDEV  [1251276441.338466] change   /devices/platform/dock.0 (platform)
When I dock:
KERNEL[1251276457.296027] change   /devices/platform/dock.0 (platform)
UDEV  [1251276457.297500] change   /devices/platform/dock.0 (platform)

So yes as you said it seems to be on change action.

Do I need to change the contents of /etc/udev/rules.d/80-thinkpad-T61.rules?
To something like:

KERNEL=="dock.0", ATTR{docked}=="1", ACTION==change,
RUN+="/etc/thinkpad/dock.sh 1"
KERNEL=="dock.0", ATTR{docked}=="0", ACTION==change,
RUN+="/etc/thinkpad/dock.sh 0"

Thanks for your help!


>
> --
>  "One disk to rule them all, One disk to find them. One disk to bring
>  them all and in the darkness grind them. In the Land of Redmond
>  where the shadows lie." -- The Silicon Valley Tarot
>   Henrique Holschuh
>
>


-- 
________________________

Daniel Castro, M.Sc.
+353 083-318-2058
dancasmo@gmail.com
castromd@tcd.ie
________________________

--0015175cff0ce16f01047207d6e4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_quote">2009/8/26 Henrique de Moraes Holschuh <span =
dir=3D"ltr">&lt;<a href=3D"mailto:hmh@hmh.eng.br">hmh@hmh.eng.br</a>&gt;</s=
pan><br><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid r=
gb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im">On Tue, 25 Aug 2009, Daniel Castro wrote:<br>
&gt; It work fine, it catches the event and does what I want to do. BUT, fo=
r some<br>
&gt; reason during startup it&#39;s creating a huge delay, like 3 minutes. =
As soon as<br>
&gt; I move the file /etc/udev/rules.d/80-thinkpad-T61.rules out of that fo=
lder<br>
&gt; startup times go back to normal.<br>
&gt;<br>
&gt; Any ideas or pointers?<br>
<br>
</div>If you need to run it only on changes (i.e. dock/undock), key it on t=
he<br>
action &quot;change&quot; and not all actions (such as &quot;add&quot; and =
&quot;remove&quot;) like you<br>
seem to be doing by not keying to an action at all...<br>
<br>
&quot;udevadm monitor&quot; can help you see the different actions. =A0Ask =
it to show<br>
the full environment.</blockquote><div>Not sure I understand right...<br><b=
r>udevadm monitor shows me:<br><br>When I undock:<br>KERNEL[1251276441.3370=
03] change=A0=A0 /devices/platform/dock.0 (platform)<br>UDEV=A0 [1251276441=
.338466] change=A0=A0 /devices/platform/dock.0 (platform)<br>
When I dock:<br>KERNEL[1251276457.296027] change=A0=A0 /devices/platform/do=
ck.0 (platform)<br>UDEV=A0 [1251276457.297500] change=A0=A0 /devices/platfo=
rm/dock.0 (platform)<br><br>So yes as you said it seems to be on change act=
ion.<br>
<br>Do I need to change the contents of  /etc/udev/rules.d/80-thinkpad-T61.=
rules?<br>To something like:<br><br>KERNEL=3D=3D&quot;dock.0&quot;, ATTR{do=
cked}=3D=3D&quot;1&quot;, ACTION=3D=3Dchange, RUN+=3D&quot;/etc/thinkpad/do=
ck.sh 1&quot;<br>

KERNEL=3D=3D&quot;dock.0&quot;, ATTR{docked}=3D=3D&quot;0&quot;, ACTION=3D=
=3Dchange, RUN+=3D&quot;/etc/thinkpad/dock.sh 0&quot;<br><br>Thanks for you=
r help!<br><br></div><blockquote class=3D"gmail_quote" style=3D"border-left=
: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1e=
x;">
<br>
<br>
--<br>
 =A0&quot;One disk to rule them all, One disk to find them. One disk to bri=
ng<br>
 =A0them all and in the darkness grind them. In the Land of Redmond<br>
 =A0where the shadows lie.&quot; -- The Silicon Valley Tarot<br>
<font color=3D"#888888"> =A0Henrique Holschuh<br>
<br>
</font></blockquote></div><br><br clear=3D"all"><br>-- <br>________________=
________<br><br>Daniel Castro, M.Sc.<br>+353 083-318-2058<br><a href=3D"mai=
lto:dancasmo@gmail.com">dancasmo@gmail.com</a><br><a href=3D"mailto:castrom=
d@tcd.ie">castromd@tcd.ie</a><br>
________________________<br>

--0015175cff0ce16f01047207d6e4--