[systemd-devel] Problem with modprobe in lm_sensors.service
Lennart Poettering
lennart at poettering.net
Mon Oct 27 07:34:10 PDT 2014
On Mon, 06.10.14 14:41, Dale R. Worley (worley at alum.mit.edu) wrote:
> I am running Fedora 16 with kernel 3.14.19-100.fc19.x86_64 and
> systemd-204-21.fc19.x86_64.
>
> On startup (and sometimes shutdown), I see a message like this in
> /var/log/messages:
>
> Oct 6 13:53:37 hobgoblin modprobe[623]: modprobe: ERROR: missing parameters. See -h.
>
> This message appears to be due to invocations of modprobe with these
> arguments:
>
> /sbin/modprobe -qab
> /sbin/modprobe -qabr
>
> Grepping all the system files (and looking in the journal), it seems
> likely that these invocations are made by systemd, under control of
> /usr/lib/systemd/system/lm_sensors.service:
>
> [Unit]
> Description=Initialize hardware monitoring sensors
> After=syslog.target
>
> [Service]
> EnvironmentFile=/etc/sysconfig/lm_sensors
> Type=oneshot
> RemainAfterExit=yes
> ExecStart=-/sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
> ExecStart=/usr/bin/sensors -s
> ExecStop=-/sbin/modprobe -qabr $BUS_MODULES $HWMON_MODULES
>
> [Install]
> WantedBy=multi-user.target
>
> Which suggests that $BUS_MODULES and $HWMON_MODULES are empty in this
> context.
>
> Is it normal for these variables to be empty (in which case, the
> lm_sensors people need to fix their .service file) or is systemd
> supposed to be providing values here (in wich case, this is a systemd
> problem)?
>
> (And if it's a problem with the .service file, is there a "standard"
> way to avoid this problem that I can suggest to the lm_sensors
> people?)
I'd recommend for the lm_sensors package to migrate the modules list
into normal /etc/modules-load.d/ files and then remove the relevant
bits from /etc/sysconfig, all from a %post script. Loading kernel
modules manually in individual packages is really confusing for the
admin, and not recommended.
The way modprobe works and this unit tries to make use of are
incompatible if no modules are configured in lm-sensor's sysconfig
file. THis can be fied by changing modprobe to accept empty arguments
list, or by not using it this way (and adding a wrapper scripts)
Also not that unloading kernel modules is merely a
debugging/testing/developer tool. It's nothing that should ever happen
during normal operation, as there are a few races left. The ExecStop=
line is hence really really wrong. Kernel modules should *not* be
unloaded during shutdown.
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list