Bug 7489 - fedora-loadmodules service fails
Summary: fedora-loadmodules service fails
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-16 11:10 CEST by AL13N
Modified: 2013-01-06 18:24 CET (History)
1 user (show)

See Also:
Source RPM: systemd
CVE:
Status comment:


Attachments

Description AL13N 2012-09-16 11:10:24 CEST
I've seen this alot, and never paid it too much mind, but this time, i got to the bottom of it:


[root@localhost ~]# cat /lib/systemd/fedora-loadmodules 
#!/bin/bash

# Load other user-defined modules
for file in /etc/sysconfig/modules/*.modules ; do
  [ -x $file ] && $file
done

# Load modules (for backward compatibility with VARs)
if [ -f /etc/rc.modules ]; then
        /etc/rc.modules
fi


1) if there is no modules the for loop will run once with "*.modules" and have exit code 1

we should safeguard against it:


...
# Load other user-defined modules
if test "/etc/sysconfig/modules/*.modules" != /etc/sysconfig/modules/*.modules; then
  for file in /etc/sysconfig/modules/*.modules ; do
    [ -x $file ] && $file
  done
fi
...


2) in /etc/rc.modules, it loads modules from /etc/modprobe.preload.d/*

which is all find and dandy.

for me there is a cpufreq in it with 4 modules:

[root@localhost ~]# cat /etc/modprobe.preload.d/cpufreq 
powernow-k8
cpufreq_powersave
cpufreq_conservative
cpufreq_ondemand



dmesg | grep power showed me why powernow-k8 isn't loaded:

[root@localhost ~]# dmesg | grep power
[    9.865392] powernow-k8: Found 1 AMD Athlon(tm) 64 Processor 3400+ (1 cpu cores) (version 2.20.00)
[    9.866496] [Firmware Bug]: powernow-k8: No PSB or ACPI _PSS objects
[    9.866498] powernow-k8: Make sure that your BIOS is up to date and Cool'N'Quiet support is enabled in BIOS setup


in other words... Cool'N'Quiet was disabled in BIOS, which often happens in servers.

perhaps when detecting cpufreq support we should check if we allow it? before adding this to preload?
AL13N 2012-09-16 11:11:18 CEST

CC: (none) => mageia

Comment 1 Colin Guthrie 2012-09-16 17:16:03 CEST
Ahh right it's the [ -x $file ] bit. We can just change that to if [ -x $file ]; then... fi and it'll be fine. I think that's slightly neater than the outside if, but that's just my opinion.

Also regarding the cpu freq stuff specifically, I think the kernel can now handle autoloading a lot better and we may be able to get rid of a lot of the old manual detection stuff these days. Will have to look into it tho'.
Comment 2 AL13N 2012-09-16 17:21:18 CEST
inside the loop, it indeed returns the return value if it's not there, so if you delete rc.modules; it'll fail too

still, i think for powerstuff, you're gonna have to try and start it and check result or check with BIOS if it's available (which sounds undoable)
Comment 3 Colin Guthrie 2013-01-06 18:24:05 CET
OK, I added that simple fix to the initscripts in cauldron.

As I suspect 99.9% of people do not delete /etc/rc.modules, I don't think this is really that much of a practical cause for exit failures, but all the same it's good to fix it :)

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.