From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Gerald V. Livingston II" Date: Mon, 13 Aug 2007 07:06:27 +0000 Subject: Re: udev not running new rules Message-Id: <4115.65.170.133.237.1186988787.squirrel@webmail.sysmatrix.net> List-Id: References: <1186927115.3225.10.camel@tigger> In-Reply-To: <1186927115.3225.10.camel@tigger> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Peter Gordon said: >> > > > The rule z19_persistent-anet.rules is: >> > > > >> > > > PROGRAM="/var/www/lib/produce_persistent_rules.pl" >> > > > >> > > > The object of the program is to rename one of the NICs, and simply >> produces a rule >> > > > SUBSYSTEMS="pci", KERNELS="0000:09:01.0", NAME="ctl" >> > > > >> > > > It runs a Perl program that creates the file >> ../persistent-net.rules. Kay Siever said: >> You need to apply the result of the rule creation in the same event, >> with the same rule that created the rules file for future events. Just >> look at the standard solution for persistent network interfaces that >> comes with udev, which probably just solves your problem anyway, or what >> do you miss from it? Peter Gordon said: > My problem is this. I need to create the rules file at boot up since the > devices available may change from boot to boot, and the PCI addresses > are not guaranteed to be the same. > > So I need to create the rules file and then get those rules run. > > I had a look at the persistent network interfaces but I can't see how > that helps, since the rules are already extant. What does your perl program DO to get the info to write into the new rules file? It obviously somehow knows it needs to write "SUBSYSTEMS="pci", KERNELS="0000:09:01.0"" into the file. Rather than writing that to a file, USE it to name the device. Have it spit the PCI slot info into an environment variable the way the other persistent rules do then use that var in the naming rule. Now, I HONESTLY don't know if an environment variable can be used on the right side of an "=" but what I've typed below looks reasonable if it can. If I'm way off base I'm sure the fine folks on this list will explain a more proper way to use an ENV{VAR} that your perl program has made available. I'm not trying to write the rule, just point in the right direction. SUBSYSTEMS="pci", KERNELS=ENV{CTLCARD}, NAME="ctl" If ENV{CTLCARD} can't be used to the right of = then you have to think about what your perl program is using to identify the correct card and use THAT in the rule: SUBSYSTEMS="pci" ENV{IDENT}={what perl uses to find the card}, NAME="ctl" You have to find a way to make your perl program write identifying info for all of the cards into the environment the way scsi_id writes drive serial numbers into the environment, then use something from that list to grab the right card. You may have to poke around in the scsi_id source and write something similar for your NIC problem. All rules are read into memory when udev loads at boot time then never again. Run udevtest against a device to see it in action. Gerald ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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