hbriese/fancon

fancon always tests fans, tries to write /etc/fancon.conf

FelixSchwarz opened this issue · 4 comments

I compiled git version de5bb40 on Fedora 31.

Steps to Reproduce

sudo ./fancon start
20/07/06 16:45 [81198] <warning> Unknown argument 'start' from statement 'start'
Starting controller
Testing fans, this may take a long time.
Don't stress your system!
Tests …

Expected behavior

  • no warning about "Unknown argument 'start'"
  • fancon just uses the preconfigured /etc/fanconf.conf, does not write to /etc

Environment

  • Version: git version de5bb40
  • OS: Fedora 31
  • Kernel: 5.7.7-100.fc31.x86_64

Additional context

fancon_system_info.txt

Can you please pull the latest commit (563c9db) and try again with 'sudo fancon start -v'.
Does /etc/fancon.conf not exist at all after the tests have complete?
Also please configure enable_path (enable_path: "/sys/class/hwmon/hwmon0/pwm6_enable").
The sample configuration in README has been updated to show this step and the removal of the -> a couple of lines above

The start argument now works as expected, thank you.

Does /etc/fancon.conf not exist at all after the tests have complete?

The configuration file does exist but fancon still does not work as I'd like.

20/07/07 08:53 [20999] <debug> No config found
Starting controller
Testing fans, this may take a long time.
Don't stress your system!
hwmon0/fan1: testing
hwmon0/fan2: testing
hwmon0/fan3: testing
hwmon0/fan4: testing
hwmon0/fan5: testing
hwmon0/fan6: testing
hwmon1/fan1: testing
Tests 94.2857% complete
Testing complete. Configure devices at: "/etc/fancon.conf"
20/07/07 08:59 [20999] <warning> hwmon0/fan1: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon0/fan2: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon0/fan3: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon0/fan4: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon0/fan5: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon0/fan6: skipping - curve not configured & sensor not configured
20/07/07 08:59 [20999] <warning> hwmon1/fan1: skipping - curve not configured & sensor not configured
Awaiting configuration

Afterwards I stopped/started the software manually (Ctrl+C).

However I preferred if fancon would not generate a configuration by default so it could be started on a read-only file system for example (or in a pretty restrictive SElinux context). The code should IMHO never modify the configuration by itself unless explicitly specified.

Then I noticed that fancon's test mode is also run for fans with incomplete configuration leading to long startup times. Then automatic configuration caused my CPU fan to be stopped afterwards and triggered a (likely) vbios bug for my gfx card causing high pitched noise (similar coil whine).

So what I'd like to see is a mode of operation where fancon just relies on the existing configuration with no automatic testing/config modification so I can configure exactly what I need.

Not sure if this should be a separate issue but I noticed that fancon somehow touches the fan configuration even for ignored devices:

fan {
    label: "hwmon1/fan1"
    sensor: "hwmon1/edge"
    temp_to_rpm: "64: 0%, 65: 30%, 80: 50%, 90: 100%"
    rpm_to_pwm: "1743: 0, 1744: 102, 2745: 204, 3109: 255"
    ignore: true
   # ^^^^^^^^^^
    pwm_path: "/sys/class/hwmon/hwmon1/pwm1"
    rpm_path: "/sys/class/hwmon/hwmon1/fan1_input"
    enable_path: "/sys/class/hwmon/hwmon1/pwm1_enable"
    driver_flag: 2
}

This is my gfx card and its vbios is a bit buggy and can cause "coil whine" in some power management states.

Please test the latest release. Tests no longer occur automatically.
How are the configs of ignored fans touched?