From: Patrick Williams <patrick@stwcx.xyz>
To: Matt Spinler <mspinler@linux.vnet.ibm.com>
Cc: Joel Stanley <joel@jms.id.au>,
OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: Starting the phosphor-hwmon service from udev rules
Date: Tue, 29 Nov 2016 20:19:02 -0600 [thread overview]
Message-ID: <20161130021902.GT15757@heinlein.lan> (raw)
In-Reply-To: <accb6902-8485-6f7f-c981-4930bb911b08@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2681 bytes --]
Matt,
We had a phone discussion last night with Joel, Andrew J, and Brad and I
was suppose to catch up with you today and never found time to. (It was
half-impromptu and half-miscommunication on the desired topic.)
The net is that we came up with a third option for specifying these:
1. Unique udev rules per device with corresponding environment file, and
single systemd service,
2. Single udev rule per driver, unique systemd service file (with
corresponding environment file?) per device.
3. Single udev rule per driver, single template systemd service file per
application (ex. phosphor-hwmon@.service), unique environment file
per device.
On Tue, Nov 29, 2016 at 10:30:12AM -0600, Matt Spinler wrote:
> So now I think the rule would look something like:
> SUBSYSTEM=="hwmon", DEVPATH=="*i2c-3/3-0077/*", ACTION == "add",
> TAG+="systemd",
> ENV{SYSTEMD_WANTS}+="phosphor-hwmon-3-0077@/sys/class/hwmon/%k.service"
The 'SYSTEMD_WANTS' is useful if you want to trigger a specific
service. If you leave that out, by default systemd triggers a @.device,
which other services can depend on. sys-class-i2c-dev-i2c-3-0077.device
maybe in this case?
> and could use the Environment or EnvironmentFile directive in the
> generated device specific unit file to pick up threshold vars.
In obmc-console@.service we have an example of using 'BindsTo'. I think
we could write the phosphor-hwmon@.service to 'BindTo=sys-%i' and also
ConditionPathExists=/etc/conf.d/phosphor-hwmon-%i ,
EnvironmentFile=/etc/conf.d/phosphor-hwmon-%i ?
> Another issue I have is if the MRW should have the knowledge of if a
> device has a hwmon driver or not? While it would make things a lot more
> simple if it did, I'm not sure if it's in its domain. If it doesn't,
> then it would either still generate rules and unit files for every I2C
> device and some just wouldn't get used, or we'd have to keep that
> knowledge in our tree somewhere.
> Thoughts on that?
Doesn't it have to? It isn't just that there is an lm77 sensor out on
an i2c bus and therefore we create the environment file. The
environment file needs to have a decent amount of information, such as
what is the "NiceName" of the sensor ("FrontAmbient" maybe). When you
talk about one of the MAX fan controller chips we potentially have
multiple fans on that chip so it more than one "sensor" worth of
configuration as well. I can't imagine how the MRW data wouldn't
effectively encode that we expect the device to have an hwmon driver
(not directly, but indirectly by the presence of this information).
--
Patrick Williams
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
next prev parent reply other threads:[~2016-11-30 2:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-28 16:31 Starting the phosphor-hwmon service from udev rules Matt Spinler
2016-11-29 1:28 ` Joel Stanley
2016-11-29 2:39 ` Patrick Williams
2016-11-29 2:42 ` Patrick Williams
2016-11-29 16:30 ` Matt Spinler
2016-11-30 1:14 ` Andrew Jeffery
2016-11-30 2:19 ` Patrick Williams [this message]
2016-12-07 19:44 ` Matt Spinler
2016-12-07 22:38 ` Patrick Williams
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=20161130021902.GT15757@heinlein.lan \
--to=patrick@stwcx.xyz \
--cc=joel@jms.id.au \
--cc=mspinler@linux.vnet.ibm.com \
--cc=openbmc@lists.ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.