From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Thu, 11 Mar 2010 09:33:49 +0000 Subject: Re: Starting with udev Message-Id: List-Id: References: <20100311095534.637ab0a7@tosh-l20.laptop> In-Reply-To: <20100311095534.637ab0a7@tosh-l20.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Thu, Mar 11, 2010 at 09:55, Salvatore De Paolis 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