Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print out configuration issues on stderr #26

Closed
techsy730 opened this issue Mar 2, 2022 · 2 comments · Fixed by #27
Closed

Print out configuration issues on stderr #26

techsy730 opened this issue Mar 2, 2022 · 2 comments · Fixed by #27

Comments

@techsy730
Copy link
Contributor

Print out a warning about Configuration issues to stderr (probably add --silent option too for the CLI for those that don't even want that printed)
Configuration issues such as:

  • a .ron file that doesn't parse as a valid Rust syntax datatype (syntax errors, etc)
  • a .ron file that had unexpected types (like an assignments/foo.ron whose contents is something like ["a", "b"], aka an Array literal instead of a Map literal
  • configuration settings that are valid in terms of types, but don't actually make sense. Like a cpu scheduler profile that is unrecognized (neither '

The daemon should probably keep track of which .ron files it has printed such a warning about in the past, and not warn about those again unless the modification time of the file has been updated since the last printed warning.
That way it doesn't repeat this warning every time system76-scheduler "runs a renice cycle".

Reproduction:

Create a file /etc/system76-scheduler/assignments/invalid.ron
And populate it with something with a blatantly invalid syntax like

{
  f:
}

(no quotes around f and no symbol f is currently defined, no value listed)

Restart the com.system76.Scheduler.service service.
Note how nothing shows up in journalctl (journalctl -eu com.system76.Scheduler.service)

Also, running RUST_LOG=system76-scheduler=warn system76-scheduler daemon manually, no warnings print out.

@techsy730
Copy link
Contributor Author

Actually, pause this bug.

I think maybe /etc/system76-scheduler/assignments isn't being read at all? Investigating

@techsy730
Copy link
Contributor Author

Actually, pause this bug.

I think maybe /etc/system76-scheduler/assignments isn't being read at all? Investigating

If this is happening, I can't tell.

But editing the default.ron to be invalid causes it to ignore that file silently.

techsy730 added a commit to techsy730/system76-scheduler that referenced this issue Mar 2, 2022
See pop-os#26: this fixes the "failed to parse" situation
techsy730 added a commit to techsy730/system76-scheduler that referenced this issue Mar 2, 2022
See pop-os#26: this fixes the "failed to parse" situation
@jacobgkau jacobgkau linked a pull request Mar 10, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants