Starting the phosphor-hwmon service from udev rules

Matt Spinler mspinler at linux.vnet.ibm.com
Tue Nov 29 03:31:20 AEDT 2016


I am working on a story this sprint to start the phosphor-hwmon service 
from udev rules.  In addition to just starting the service based on a 
device path, I need to be able to communicate to it some threshold 
values, like critical high temps for example.

I have a proposal for the rules at 
https://gerrit.openbmc-project.xyz/#/c/1243/.

It has lines like:

SUBSYSTEM=="hwmon", DEVPATH=="*i2c-3/3-0077/*", ACTION == "add", 
TAG+="systemd", 
ENV{SYSTEMD_WANTS}+="phosphor-hwmon@/sys/class/hwmon/%k.service", 
ENV{ENVFILE}+="/etc/hwmon.d/hwmon-bmp280-3-77.conf"

where the .conf file will contain any threshold values, maybe like 
CRIT=50.  The command line in the unit file would then somehow make a 
udevadm call to pull out the ENVFILE so it can get passed into the 
executable along with the device path.

Is this the recommended way to go about doing this?  Or instead of 
having a separate udev rule for each device, but 1 service file, is it 
better to have 1 udev rule but separate service files?

Thanks




More information about the openbmc mailing list