[ltp] Re: A new udev rule gives me 3min startup delay
Daniel Castro
linux-thinkpad@linux-thinkpad.org
Thu, 27 Aug 2009 09:44:18 +0100
--0015175d0396c42df204721b92b0
Content-Type: multipart/alternative; boundary=0015175d0396c42de704721b92ae
--0015175d0396c42de704721b92ae
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Ok let me simplify the question.
Attached is the output of: ~$ udevadm monitor --environment
With that, what do I need to do to create a rule that catches those dock an=
d
undock events and run a /etc/thinkpad/dock.sh script. Either one single
script that will know the state (docked or undocked) ro two separate
scripts, I don't mind.
Thanks again!
2009/8/26 Daniel Castro <castromd@tcd.ie>
> I would have thought that even just
>
> KERNEL=3D=3D"dock.0", ACTION=3D=3Dchange, RUN+=3D"/etc/thinkpad/dock.sh"
>
> should work as I'm reading using
>
> DOCKED=3D$(cat /sys/devices/platform/dock.0/docked)
>
> on that /etc/thinkpad/dock.sh script....
>
> Not sure what's wrong.... I hope someone can shed some light...
>
> ~$ udevadm monitor --environment
> monitor will print the received events for:
> UDEV - the event which udev sends out after rule processing
> KERNEL - the kernel uevent
>
> KERNEL[1251303441.446118] change /devices/platform/dock.0 (platform)
> UDEV_LOG=3D3
> ACTION=3Dchange
> DEVPATH=3D/devices/platform/dock.0
> SUBSYSTEM=3Dplatform
> EVENT=3Dundock
> MODALIAS=3Dplatform:dock
> SEQNUM=3D4370
>
>
> 2009/8/26 Daniel Castro <castromd@tcd.ie>
>
>
>> 2009/8/26 Bj=F8rn Mork <bjorn@mork.no>
>>
>>> Daniel Castro <castromd@tcd.ie> writes:
>>>
>>> > Do I need to change the contents of
>>> /etc/udev/rules.d/80-thinkpad-T61.rules?
>>> > To something like:
>>> >
>>> > KERNEL=3D=3D"dock.0", ATTR{docked}=3D=3D"1", ACTION=3D=3Dchange,
>>> > RUN+=3D"/etc/thinkpad/dock.sh 1"
>>> > KERNEL=3D=3D"dock.0", ATTR{docked}=3D=3D"0", ACTION=3D=3Dchange,
>>> > RUN+=3D"/etc/thinkpad/dock.sh 0"
>>>
>>> Not that it matters much, but you can simplify this to a single rule:
>>>
>>> KERNEL=3D=3D"dock.0", ACTION=3D=3Dchange, RUN+=3D"/etc/thinkpad/dock.s=
h
>>> $attr{docked}"
>>
>> didn't work this way either...
>>
>>>
>>>
>>>
>>>
>>> Bj=F8rn
>>> --
>>> The linux-thinkpad mailing list home page is at:
>>> http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpad
>>>
>>>
>>
>>
>> --
>> ________________________
>>
>> Daniel Castro, M.Sc.
>> +353 083-318-2058
>> dancasmo@gmail.com
>> castromd@tcd.ie
>> ________________________
>>
>
>
>
> --
> ________________________
>
> Daniel Castro, M.Sc.
> +353 083-318-2058
> dancasmo@gmail.com
> castromd@tcd.ie
> ________________________
>
--=20
________________________
Daniel Castro, M.Sc.
+353 083-318-2058
dancasmo@gmail.com
castromd@tcd.ie
________________________
--0015175d0396c42de704721b92ae
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Ok let me simplify the question.<br>Attached is the output of: ~$ udevadm m=
onitor --environment<br><br>With that, what do I need to do to create a rul=
e that catches those dock and undock events and run a /etc/thinkpad/dock.sh=
script. Either one single script that will know the state (docked or undoc=
ked) ro two separate scripts, I don't mind.<br>
<br>Thanks again!<br><br><div class=3D"gmail_quote">2009/8/26 Daniel Castro=
<span dir=3D"ltr"><<a href=3D"mailto:castromd@tcd.ie">castromd@tcd.ie</=
a>></span><br><blockquote class=3D"gmail_quote" style=3D"border-left: 1p=
x solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I would have thought that even just<div class=3D"im"><br><br>KERNEL=3D=3D&q=
uot;dock.0", ACTION=3D=3Dchange, RUN+=3D"/etc/thinkpad/dock.sh&qu=
ot;<br><br></div>should work as I'm reading using<div class=3D"im"><br>=
<br>DOCKED=3D$(cat /sys/devices/platform/dock.0/docked)<br>
<br></div>on that /etc/thinkpad/dock.sh script....<br><br>Not sure what'=
;s wrong.... I hope someone can shed some light...<br><br>~$ udevadm monito=
r --environment<br>monitor will print the received events for:<br>UDEV - th=
e event which udev sends out after rule processing<br>
KERNEL - the kernel uevent<br><br>KERNEL[1251303441.446118] change=A0=A0 /d=
evices/platform/dock.0 (platform)<br>UDEV_LOG=3D3<br>ACTION=3Dchange<br>DEV=
PATH=3D/devices/platform/dock.0<br>SUBSYSTEM=3Dplatform<br>EVENT=3Dundock<b=
r>MODALIAS=3Dplatform:dock<br>
SEQNUM=3D4370<br><br><br><div class=3D"gmail_quote">2009/8/26 Daniel Castro=
<span dir=3D"ltr"><<a href=3D"mailto:castromd@tcd.ie" target=3D"_blank"=
>castromd@tcd.ie</a>></span><div><div></div><div class=3D"h5"><br><block=
quote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 2=
04); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><div class=3D"gmail_quote">2009/8/26 Bj=F8rn Mork <span dir=3D"ltr"><=
;<a href=3D"mailto:bjorn@mork.no" target=3D"_blank">bjorn@mork.no</a>></=
span><div><br><blockquote class=3D"gmail_quote" style=3D"border-left: 1px s=
olid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Daniel Castro <<a href=3D"mailto:castromd@tcd.ie" target=3D"_blank"=
>castromd@tcd.ie</a>> writes:<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"dock.0", ATTR{docked}=3D=3D"1", ACTIO=
N=3D=3Dchange,<br>
> RUN+=3D"/etc/thinkpad/dock.sh 1"<br>
> KERNEL=3D=3D"dock.0", ATTR{docked}=3D=3D"0", ACTIO=
N=3D=3Dchange,<br>
> RUN+=3D"/etc/thinkpad/dock.sh 0"<br>
<br>
</div>Not that it matters much, but you can simplify this to a single rule:=
<br>
<br>
=A0KERNEL=3D=3D"dock.0", ACTION=3D=3Dchange, RUN+=3D"/etc/th=
inkpad/dock.sh $attr{docked}"</blockquote></div><div>didn't work t=
his way either... <br></div><div><blockquote class=3D"gmail_quote" style=3D=
"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padd=
ing-left: 1ex;">
<br>
<br>
<br>
<br>
Bj=F8rn<br>
<font color=3D"#888888">--<br>
The linux-thinkpad mailing list home page is at:<br>
<a href=3D"http://mailman.linux-thinkpad.org/mailman/listinfo/linux-thinkpa=
d" target=3D"_blank">http://mailman.linux-thinkpad.org/mailman/listinfo/lin=
ux-thinkpad</a><br>
<br>
</font></blockquote></div></div><br><br clear=3D"all"><div><div></div><div>=
<br>-- <br>________________________<br><br>Daniel Castro, M.Sc.<br>+353 083=
-318-2058<br><a href=3D"mailto:dancasmo@gmail.com" target=3D"_blank">dancas=
mo@gmail.com</a><br>
<a href=3D"mailto:castromd@tcd.ie" target=3D"_blank">castromd@tcd.ie</a><br=
>
________________________<br>
</div></div></blockquote></div></div></div><div><div></div><div class=3D"h5=
"><br><br clear=3D"all"><br>-- <br>________________________<br><br>Daniel C=
astro, M.Sc.<br>+353 083-318-2058<br><a href=3D"mailto:dancasmo@gmail.com" =
target=3D"_blank">dancasmo@gmail.com</a><br>
<a href=3D"mailto:castromd@tcd.ie" target=3D"_blank">castromd@tcd.ie</a><br=
>
________________________<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>___________=
_____________<br><br>Daniel Castro, M.Sc.<br>+353 083-318-2058<br><a href=
=3D"mailto:dancasmo@gmail.com">dancasmo@gmail.com</a><br><a href=3D"mailto:=
castromd@tcd.ie">castromd@tcd.ie</a><br>
________________________<br>
--0015175d0396c42de704721b92ae--
--0015175d0396c42df204721b92b0
Content-Type: application/octet-stream; name=log
Content-Disposition: attachment; filename=log
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fyv909o40
RG9jazoKCktFUk5FTFsxMjUxMzYxNzk5Ljc4MTI4NV0gY2hhbmdlICAgL2RldmljZXMvcGxhdGZ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