From: Roland Dreier <rdreier@cisco.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: RFC: InfiniBand hotplug agent
Date: Wed, 22 Mar 2006 20:36:44 +0000 [thread overview]
Message-ID: <ada1wwub4ir.fsf@cisco.com> (raw)
In-Reply-To: <ada1wwu47xf.fsf@cisco.com>
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&kid\x110944&bid$1720&dat\x121642
_______________________________________________
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
next prev parent reply other threads:[~2006-03-22 20:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 19:05 RFC: InfiniBand hotplug agent Roland Dreier
2006-03-22 19:47 ` Marco d'Itri
2006-03-22 20:36 ` Roland Dreier [this message]
2006-03-23 5:13 ` Greg KH
2006-03-23 15:19 ` Scott James Remnant
2006-03-23 17:11 ` Roland Dreier
2006-03-23 23:31 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ada1wwub4ir.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).