From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roland Dreier Date: Wed, 22 Mar 2006 20:36:44 +0000 Subject: Re: RFC: InfiniBand hotplug agent Message-Id: 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 Thanks for the comments. Marco> Remove this if statement and use such a rule instead: Marco> ACTION="add", SUBSYSTEM="infiniband", RUN+="infiniband.agent" Good point. Marco> # is this actually needed? can node_desc really not exist? Marco> [ -e "$DESC_PATH" ] || exit 0 Certainly on kernels prior to 2.6.17 it won't be there... Marco> # by using read instead of cat you save a fork+exec read Another good point. Marco> But probably using hostname(1) in a RUN rule is not such a Marco> great idea, because at boot time the script will be run Marco> long before the system hostname will have been set by an Marco> init script. Hmm, that's a problem, and indeed if I let the driver be loaded on boot, I end up with "(none)" as the hostname (I usually blacklist my IB drivers, because I do a lot of driver development and it's a pain when the system crashes on boot because of bugs I wrote). Do you think using /etc/hostname instead (on Debian at least) is a palatable solution? It seems this will end up being distro specific unfortunately... Here's what I just tested (along with your ACTION="add" suggestion), and it worked well even when the driver is loaded at boot time: #!/bin/sh -e DESC_PATH="/sys/$DEVPATH/node_desc" [ -e "$DESC_PATH" ] || exit 0 read OLD_DESC < $DESC_PATH read HOSTNAME < /etc/hostname echo -n "$HOSTNAME ($OLD_DESC)" > $DESC_PATH exit 0 Do you think this is OK for Debian? Obviously I'll have to come up with something else for Gentoo, Fedora, etc. Thanks, Roland ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&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