Linux Hotplug development
 help / color / mirror / Atom feed
* Starting with udev
@ 2010-03-11  8:55 Salvatore De Paolis
  2010-03-11  9:33 ` Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Salvatore De Paolis @ 2010-03-11  8:55 UTC (permalink / raw)
  To: linux-hotplug

Hi all,

i'm really new with udev and i was following the writing udev rules to
understand how it works.

What i wanted to do, is to mount and execute a script once a usb device is
plugged.
To test this, i found the line:

KERNEL="sd*", ACTION="add", RUN+="/usr/bin/notify-send test test"

I wrote this in a file called 90-test.rules under /etc/udev/rules.d and
restarted udev plugged the usb device and nothing happened.

I'm using the version 151, it's updated with the writing udev rules link or
there's something i'm getting wrong?

Regards
Sal

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting with udev
  2010-03-11  8:55 Starting with udev Salvatore De Paolis
@ 2010-03-11  9:33 ` Kay Sievers
  2010-03-12 15:39 ` Salvatore De Paolis
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2010-03-11  9:33 UTC (permalink / raw)
  To: linux-hotplug

On Thu, Mar 11, 2010 at 09:55, Salvatore De Paolis <iwkse@claws-mail.org> wrote:
> i'm really new with udev and i was following the writing udev rules to
> understand how it works.
>
> What i wanted to do, is to mount and execute a script once a usb device is
> plugged.
> To test this, i found the line:
>
> KERNEL="sd*", ACTION="add", RUN+="/usr/bin/notify-send test test"
>
> I wrote this in a file called 90-test.rules under /etc/udev/rules.d and
> restarted udev plugged the usb device and nothing happened.

Udev runs at the system-level as root, it can not talk to your user
session where the notification would appear. You have to subscribe to
events from your user session, and not put system-wide rules into
udev, to get events in your session.

Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting with udev
  2010-03-11  8:55 Starting with udev Salvatore De Paolis
  2010-03-11  9:33 ` Kay Sievers
@ 2010-03-12 15:39 ` Salvatore De Paolis
  2010-03-12 15:53 ` Kay Sievers
  2010-03-12 16:57 ` Salvatore De Paolis
  3 siblings, 0 replies; 5+ messages in thread
From: Salvatore De Paolis @ 2010-03-12 15:39 UTC (permalink / raw)
  To: linux-hotplug

On Thu, 11 Mar 2010 10:33:49 +0100
Kay Sievers <kay.sievers@vrfy.org> wrote:

> Udev runs at the system-level as root, it can not talk to your user
> session where the notification would appear. You have to subscribe to
> events from your user session, and not put system-wide rules into
> udev, to get events in your session.
> 
> Kay

Thank's it's clear now the logic under it. By the way I didn't find a lot of
documentation about it. Writing udev rules [1] doesn't help from this side.
I'll get the source and build the doc.
Otherwise do you have other useful links?

thanks
Sal

[1] http://reactivated.net/writing_udev_rules.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting with udev
  2010-03-11  8:55 Starting with udev Salvatore De Paolis
  2010-03-11  9:33 ` Kay Sievers
  2010-03-12 15:39 ` Salvatore De Paolis
@ 2010-03-12 15:53 ` Kay Sievers
  2010-03-12 16:57 ` Salvatore De Paolis
  3 siblings, 0 replies; 5+ messages in thread
From: Kay Sievers @ 2010-03-12 15:53 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Mar 12, 2010 at 16:39, Salvatore De Paolis <iwkse@claws-mail.org> wrote:
> On Thu, 11 Mar 2010 10:33:49 +0100
> Kay Sievers <kay.sievers@vrfy.org> wrote:
>
>> Udev runs at the system-level as root, it can not talk to your user
>> session where the notification would appear. You have to subscribe to
>> events from your user session, and not put system-wide rules into
>> udev, to get events in your session.

> Thank's it's clear now the logic under it. By the way I didn't find a lot of
> documentation about it. Writing udev rules [1] doesn't help from this side.
> I'll get the source and build the doc.
> Otherwise do you have other useful links?

This is maybe the closest to what you are looking for. Ignore all the
HAL bits, that all has changed, but the model is almost the same. Look
at the diagram at page 17 for the flow of events in a more complicated
example:
  http://people.freedesktop.org/~david/talks/dynamic-device-handling-OLS-2006.pdf

Less pretty diagrams, but pretty much up-to-date:
  http://people.freedesktop.org/~david/talks/Plumbers-2009-Sievers-Zeuthen-Replugging-The-Modern-Desktop.pdf

Kay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Starting with udev
  2010-03-11  8:55 Starting with udev Salvatore De Paolis
                   ` (2 preceding siblings ...)
  2010-03-12 15:53 ` Kay Sievers
@ 2010-03-12 16:57 ` Salvatore De Paolis
  3 siblings, 0 replies; 5+ messages in thread
From: Salvatore De Paolis @ 2010-03-12 16:57 UTC (permalink / raw)
  To: linux-hotplug

On Fri, 12 Mar 2010 16:53:08 +0100
Kay Sievers <kay.sievers@vrfy.org> wrote:

> This is maybe the closest to what you are looking for. Ignore all the
> HAL bits, that all has changed, but the model is almost the same. Look
> at the diagram at page 17 for the flow of events in a more complicated
> example:
>   http://people.freedesktop.org/~david/talks/dynamic-device-handling-OLS-2006.pdf
> 
> Less pretty diagrams, but pretty much up-to-date:
>   http://people.freedesktop.org/~david/talks/Plumbers-2009-Sievers-Zeuthen-Replugging-The-Modern-Desktop.pdf
> 
> Kay

Thank you a lot, this is really what I was searching.

regards
Sal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-12 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-11  8:55 Starting with udev Salvatore De Paolis
2010-03-11  9:33 ` Kay Sievers
2010-03-12 15:39 ` Salvatore De Paolis
2010-03-12 15:53 ` Kay Sievers
2010-03-12 16:57 ` Salvatore De Paolis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox