From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Tourrilhes Date: Mon, 26 Feb 2007 17:42:09 +0000 Subject: Re: PATCH : new key MODEFILE Message-Id: <20070226174209.GA961@bougret.hpl.hp.com> List-Id: References: <20070224023614.GA28903@bougret.hpl.hp.com> In-Reply-To: <20070224023614.GA28903@bougret.hpl.hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Sat, Feb 24, 2007 at 03:34:34PM +0100, Kay Sievers wrote: > On 2/24/07, Jean Tourrilhes wrote: > > I was looking into using the key name RUN and PROGRAM in udev, > >and I realised that udev attempt to run those programs even if they > >don't exist. This is a bit wasteful timewise... >=20 > Well, having rules for non-existent programs seems like the "real > waste", and I call it an configuration error. Care to explain the > benefit of such rules and extension? >=20 > Thank, > Kay Hi again, Sorry for the delay, my wife was keeping me busy over the week end ;-) Thanks for your comments. I think you are only looking at it from a strict udev perspective, while I'm looking at it from the other end. I'll try to explain it a bit better... Obviously, you never want to put rules for non-existent programs. However, life is usually messy, and it's difficult to guarantee that the rules and the program stays in sync over the full lifetime of a system. I usually clone my HDD and config files between the various systems I manage. By accident, the user may have the rules still exist and the program gone or moved. Then, I do shell programming, and in shell this type of conditional construct is quite common. For example, check the net.agent script in the udev package for the function check_program(). If it's good practice over there, it's probably good practice over here. But, if it was only for those two reasons, I would agree with you that it's not a big deal. That's why I designed it so that it's as generic as possible and can be used for many other things. For example, you can do : ------------------------------------------ KERNEL=3D"sdc1", MODEMASK{/mnt/media}=3D"0100", RUN=3D"mount /dev/%k /mnt/m= edia" ------------------------------------------ You could also do : ------------------------------------------ KERNEL=3D"sdb", MODEMASK{sda}=3D"0001", MODEMASK{sda}=3D"0002", MODE=3D"066= 6" ------------------------------------------ If you let your imagination wild, you'll probably find many other use. Have fun... Jean ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ 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