All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
@ 2014-10-08 18:42 Dale R. Worley
  2014-10-09 17:52 ` Guenter Roeck
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dale R. Worley @ 2014-10-08 18:42 UTC (permalink / raw)
  To: lm-sensors

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.

I've found the threads "PATCH: systemd integration" and "PATCH:
systemd integration version 2".  But they don't deal with the fact
that modprobe prints an error message if the list of modules to be
loaded is empty.  Those error messages go into /var/log/messages, and
eventually logwatch sends e-mail to root complaining about them.

There doesn't seem to be a facility in systemd to optionally start a
program depending on settings in another file.  So maybe what is
needed are supporting scripts along these lines:

#! /bin/sh

if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
then
    /sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
fi

exec /usr/bin/sensors -s

and

#! /bin/sh

if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
then
    /sbin/modprobe -qabr $BUS_MODULES $HWMON_MODULES
fi

Dale

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
  2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
@ 2014-10-09 17:52 ` Guenter Roeck
  2014-10-09 20:42 ` Dale R. Worley
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2014-10-09 17:52 UTC (permalink / raw)
  To: lm-sensors

On Wed, Oct 08, 2014 at 02:42:57PM -0400, Dale R. Worley 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.
> 
> I've found the threads "PATCH: systemd integration" and "PATCH:
> systemd integration version 2".  But they don't deal with the fact
> that modprobe prints an error message if the list of modules to be
> loaded is empty.  Those error messages go into /var/log/messages, and
> eventually logwatch sends e-mail to root complaining about them.
> 
> There doesn't seem to be a facility in systemd to optionally start a
> program depending on settings in another file.  So maybe what is
> needed are supporting scripts along these lines:
> 
> #! /bin/sh
> 
> if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
> then
>     /sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
> fi
> 
> exec /usr/bin/sensors -s
> 
> and
> 
> #! /bin/sh
> 
> if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
> then
>     /sbin/modprobe -qabr $BUS_MODULES $HWMON_MODULES
> fi
> 

Not sure if there is anything we can do about that; it is a distribution
problem, not a lm-sensors problem.

Jean, any idea ?

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
  2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
  2014-10-09 17:52 ` Guenter Roeck
@ 2014-10-09 20:42 ` Dale R. Worley
  2014-10-09 21:24 ` Guenter Roeck
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Dale R. Worley @ 2014-10-09 20:42 UTC (permalink / raw)
  To: lm-sensors

> From: Guenter Roeck <linux@roeck-us.net>

> Not sure if there is anything we can do about that; it is a distribution
> problem, not a lm-sensors problem.

As long as I know that the lm-sensors people don't maintain the
lm_sensors.service file and send it to the people who package Fedora,
I can report it to Fedora.  I just need feedback on who is responsible
for the file.

Dale

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
  2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
  2014-10-09 17:52 ` Guenter Roeck
  2014-10-09 20:42 ` Dale R. Worley
@ 2014-10-09 21:24 ` Guenter Roeck
  2014-10-10 14:35 ` Jean Delvare
  2014-10-10 19:22 ` Dale R. Worley
  4 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2014-10-09 21:24 UTC (permalink / raw)
  To: lm-sensors

On Thu, Oct 09, 2014 at 04:42:18PM -0400, Dale R. Worley wrote:
> > From: Guenter Roeck <linux@roeck-us.net>
> 
> > Not sure if there is anything we can do about that; it is a distribution
> > problem, not a lm-sensors problem.
> 
> As long as I know that the lm-sensors people don't maintain the
> lm_sensors.service file and send it to the people who package Fedora,
> I can report it to Fedora.  I just need feedback on who is responsible
> for the file.
> 
I had a look; you are right, the lm-sensors package includes
prog/init/lm_sensors.service; it was added last year.

Jean, any idea how to handle this ?

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
  2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
                   ` (2 preceding siblings ...)
  2014-10-09 21:24 ` Guenter Roeck
@ 2014-10-10 14:35 ` Jean Delvare
  2014-10-10 19:22 ` Dale R. Worley
  4 siblings, 0 replies; 6+ messages in thread
From: Jean Delvare @ 2014-10-10 14:35 UTC (permalink / raw)
  To: lm-sensors

Hi Dale, Guenter,

On Thu, 9 Oct 2014 10:52:15 -0700, Guenter Roeck wrote:
> On Wed, Oct 08, 2014 at 02:42:57PM -0400, Dale R. Worley 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.
> > 
> > I've found the threads "PATCH: systemd integration" and "PATCH:
> > systemd integration version 2".  But they don't deal with the fact
> > that modprobe prints an error message if the list of modules to be
> > loaded is empty.  Those error messages go into /var/log/messages, and
> > eventually logwatch sends e-mail to root complaining about them.
> > 
> > There doesn't seem to be a facility in systemd to optionally start a
> > program depending on settings in another file.  So maybe what is
> > needed are supporting scripts along these lines:
> > 
> > #! /bin/sh
> > 
> > if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
> > then
> >     /sbin/modprobe -qab $BUS_MODULES $HWMON_MODULES
> > fi
> > 
> > exec /usr/bin/sensors -s
> > 
> > and
> > 
> > #! /bin/sh
> > 
> > if [ -n "$BUS_MODULES" -o -n "$HWMON_MODULES" ]
> > then
> >     /sbin/modprobe -qabr $BUS_MODULES $HWMON_MODULES
> > fi
> > 
> 
> Not sure if there is anything we can do about that; it is a distribution
> problem, not a lm-sensors problem.
> 
> Jean, any idea ?

Jaromir Capik (Red Hat / Fedora package maintainer, Cc'd) reported the
same problem some time ago:
http://lists.lm-sensors.org/pipermail/lm-sensors/2014-January/040993.html

His proposal looks pretty much the same as what Dale just suggested:
wrapper shell scripts.

My reply is here:
http://lists.lm-sensors.org/pipermail/lm-sensors/2014-July/042145.html

As a summary, I agree that there is a problem, but I am not a big fan
of using wrapper shell scripts to solve it, for it defeats the purpose
of systemd. Unfortunately I have to admit that I did not take the time
to actually implement my idea in openSUSE, so I still don't know for
sure if it would work OK.

What really surprises me though is that Dale seems to see the problem
on Fedora, while I thought Jaromir had already committed his fix there,
regardless of upstream acceptance. This is really a system integration
issue so distributions are perfectly free to diverge. The example
systemd service files are really only templates to build upon, they can
be modified to accommodate distribution specifics as needed.

-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service
  2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
                   ` (3 preceding siblings ...)
  2014-10-10 14:35 ` Jean Delvare
@ 2014-10-10 19:22 ` Dale R. Worley
  4 siblings, 0 replies; 6+ messages in thread
From: Dale R. Worley @ 2014-10-10 19:22 UTC (permalink / raw)
  To: lm-sensors

> From: Jean Delvare <jdelvare@suse.de>

> What really surprises me though is that Dale seems to see the problem
> on Fedora, while I thought Jaromir had already committed his fix there,
> regardless of upstream acceptance.

It's possible that the patch has been put into Fedora 20 but not into
Fedora 19 (which is what I'm running).  (*Not* Fedora 16 as I
mistakenly wrote, ugh.)

> As a summary, I agree that there is a problem, but I am not a big fan
> of using wrapper shell scripts to solve it, for it defeats the purpose
> of systemd.

That's true.  On the other hand, there's no way in systemd to mark an
ExecStart action in a service as "execute this if and only if (some
condition)".

(There are Conditional qualifiers you can put on a unit, but they seem
to apply to the unit as a whole, and we always want the ExecStart of
/usr/bin/sensors to run.  If the ExecStart lines were put into Bash,
we could use shell conditionals to handle it, but that is precisely
what the design wants to avoid.  I suppose you could split the
modprobe into a separate until that is to be executed before
lm_sensors.service, and have the configuration-detector do whatever is
needed to tell systemd to ignore the unit if no modules need to be
loaded.)

> Unfortunately I have to admit that I did not take the time to
> actually implement my idea in openSUSE, so I still don't know for
> sure if it would work OK.

As James Morris said, 

    Finally, I'll offer eight opinions that computer scientists who venture into
    the real world should consider:
	    ...
	    3. Virtual << Real.
	    ...

We have to go with whatever exists.

Dale

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-10 19:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-08 18:42 [lm-sensors] systemd integration: Problem with modprobe in lm_sensors.service Dale R. Worley
2014-10-09 17:52 ` Guenter Roeck
2014-10-09 20:42 ` Dale R. Worley
2014-10-09 21:24 ` Guenter Roeck
2014-10-10 14:35 ` Jean Delvare
2014-10-10 19:22 ` Dale R. Worley

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.