From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Wed, 25 Jan 2006 18:52:23 +0000 Subject: Re: DEVLINKS and DEVNAME variables in RUN rules Message-Id: <20060125185223.GA31304@vrfy.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Jan 25, 2006 at 09:18:28PM +0300, Andrey Borzenkov wrote: > On Tuesday 24 January 2006 22:43, Kay Sievers wrote: > > On Tue, Jan 24, 2006 at 09:05:51PM +0300, Andrey Borzenkov wrote: > > > On Tuesday 24 January 2006 19:24, Olivier Blin wrote: > > > > I'd like to use the DEVNAME and DEVLINKS (thanks Kay) environment > > > > variables in a RUN rule. Unfortunately, they're not exported yet when > > > > the command to be executed is computed (i.e. when the format is > > > > applied). So, for now, I'm using a dumb trick: > > > > RUN+="/bin/sh -c '/sbin/pam_console_setowner $$DEVICE $$DEVNAME > > > > $$DEVLINKS'" > > > > > > > > Would it be possible to have the format applied right before the RUN > > > > command is run? > > > > > > Like this? This seems to work for me: > > > > > > Jan 24 21:04:24 cooker udevd-event[16049]: name_list_add: adding > > > '/sbin/pam_console_setowner $env{DEVICE} $env{DEVNAME} $env{DEVLINKS}' > > > > Applied. > > > > OK the following patch documents this difference (and the fact that RUN is > using substitutons at all). I am still curious if there is real life use for > something like `PROGRAM="check" RUN="callout %c{1}"'. Oh, the %c will just be the last result if more than one rule uses PROGRAM and should still work in almost all cases it is used, if at all. The man page is generated from the xml source in docs/ and we can't patch the man page itself and udev 082 has udev.8 moved to udev.7, cause the command udev does no longer really exist. Can you patch the udev.xml instead? Thanks, Kay ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel