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

undervolt: service contains "unrecognized arguments" #64475

Closed
VS-X opened this issue Jul 9, 2019 · 9 comments
Closed

undervolt: service contains "unrecognized arguments" #64475

VS-X opened this issue Jul 9, 2019 · 9 comments

Comments

@VS-X
Copy link

VS-X commented Jul 9, 2019

Issue description

If you try to enable undervolt service it would fail with undervolt: error: unrecognized arguments: Restart=no
I solved the issue by removing Restart="no" and Type="oneshot' from undervolt.nix, but I still don't understand why it fails, since the syntax seems to be correct.

Steps to reproduce

add services.undervolt.enable = true; to configuration.nix

Technical details

  • system: "x86_64-linux"
  • host os: Linux 5.1.16, NixOS, 19.09pre184855.beff2f8d75e (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(root): "nixos-19.09pre184855.beff2f8d75e, nixos-hardware"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@gloaming
Copy link
Contributor

gloaming commented Jul 9, 2019

The error is coming from the binary, not NixOS - kindly provide the full error from journalctl -e --unit undervolt.service.

I think I know what's happening - a backslash at the end of the line is causing systemd to read the next arguments as a continuation of ExecStart. But the error doesn't happen on 19.03, so systemd may have changed behaviour.

Please show the generated service unit:
cat $(systemctl show undervolt.service -p FragmentPath | cut -d= -f2)

Mine on 19.03 looks like this:

[Unit]
Description=Intel Undervolting Service

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/n21v70869vp3wl3c35lasy9r0dnh65sg-glibc-locales-2.27/lib/locale/locale-archive"
Environment="PATH=/nix/store/i8hgfj7pjjipn0zsqxx8ws5xv04s4nvl-undervolt-0.2.9/bin:/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/bin:/nix/store/krhqmaqal0gklh15rs2bwrqzz8mg9lrn-findutils-4.6.0/bin:/nix/store/wnjv27b3j6jfdl0968xpcymlc7chpqil-gnugrep-3.3/bin:/nix/store/x1khw8x0465xhkv6w31af75syyyxc65j-gnused-4.7/bin:/nix/store/b3n6imx9a3dr6ajbkdl2qidshcllssl1-systemd-239.20190219/bin:/nix/store/i8hgfj7pjjipn0zsqxx8ws5xv04s4nvl-undervolt-0.2.9/sbin:/nix/store/d9s1kq1bnwqgxwcvv4zrc36ysnxg8gv7-coreutils-8.30/sbin:/nix/store/krhqmaqal0gklh15rs2bwrqzz8mg9lrn-findutils-4.6.0/sbin:/nix/store/wnjv27b3j6jfdl0968xpcymlc7chpqil-gnugrep-3.3/sbin:/nix/store/x1khw8x0465xhkv6w31af75syyyxc65j-gnused-4.7/sbin:/nix/store/b3n6imx9a3dr6ajbkdl2qidshcllssl1-systemd-239.20190219/sbin"
Environment="TZDIR=/nix/store/0l3kl1z6zsh3x8d4372x2c1kzsdxnj86-tzdata-2019a/share/zoneinfo"



ExecStart=/nix/store/i8hgfj7pjjipn0zsqxx8ws5xv04s4nvl-undervolt-0.2.9/bin/undervolt \
   \
   \
   \
   \
   \
   \
   \
   \
  

Restart=no
Type=oneshot

@VS-X
Copy link
Author

VS-X commented Jul 10, 2019

Here is the journalctl log

Jul 10 09:52:21 vs-5530 systemd[1]: Starting Intel Undervolting Service...
Jul 10 09:52:21 vs-5530 undervolt[27542]: usage: undervolt [-h] [-v] [-f] [-r] [-t TEMP] [--temp-bat TEMP_BAT]
Jul 10 09:52:21 vs-5530 undervolt[27542]:                  [--throttlestop THROTTLESTOP] [--tsindex TSINDEX]
Jul 10 09:52:21 vs-5530 undervolt[27542]:                  [--core CORE] [--gpu GPU] [--cache CACHE] [--uncore UNCORE]
Jul 10 09:52:21 vs-5530 undervolt[27542]:                  [--analogio ANALOGIO]
Jul 10 09:52:21 vs-5530 undervolt[27542]: undervolt: error: unrecognized arguments: Restart=no
Jul 10 09:52:21 vs-5530 systemd[1]: undervolt.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jul 10 09:52:21 vs-5530 systemd[1]: undervolt.service: Failed with result 'exit-code'.
Jul 10 09:52:21 vs-5530 systemd[1]: Failed to start Intel Undervolting Service.

and the unit file itself:

[Unit]
Description=Intel Undervolting Service

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/1ffk1bcl759jrn0xs5n9dpp65m86xa0m-glibc-locales-2.27/lib/locale/locale-archive"
Environment="PATH=/nix/store/l33nffydwr7890mfcp6wwh56y692625y-undervolt-0.2.9/bin:/nix/store/i9cmf4j5ngnw53a5ci3y6ivqsq6qqgxl-coreutils-8.31/bin:/nix/store/9sn8a7w61ggyn4hz236if809l8pgqz2g-findutils-4.6.0/bin:/nix/store/n36nlzz27ibdvhir19dnf271xwxx4pp6-gnugrep-3.3/bin:/nix/store/nxka07915gh8g6d9as7w3w8vvsa7pkwr-gnused-4.7/bin:/nix/store/hach8csknszq07jfv8bdgqhgwmj7bcz7-systemd-242/bin:/nix/store/l33nffydwr7890mfcp6wwh56y692625y-undervolt-0.2.9/sbin:/nix/store/i9cmf4j5ngnw53a5ci3y6ivqsq6qqgxl-coreutils-8.31/sbin:/nix/store/9sn8a7w61ggyn4hz236if809l8pgqz2g-findutils-4.6.0/sbin:/nix/store/n36nlzz27ibdvhir19dnf271xwxx4pp6-gnugrep-3.3/sbin:/nix/store/nxka07915gh8g6d9as7w3w8vvsa7pkwr-gnused-4.7/sbin:/nix/store/hach8csknszq07jfv8bdgqhgwmj7bcz7-systemd-242/sbin"
Environment="TZDIR=/nix/store/y7nadwy081wkvfw4izcw29fyp4lz47l3-tzdata-2019a/share/zoneinfo"



ExecStart=/nix/store/l33nffydwr7890mfcp6wwh56y692625y-undervolt-0.2.9/bin/undervolt \
   \
  --core -100 \
  --cache -100 \
  --gpu -75 \
  --uncore -100 \
  --analogio -100 \
   \
   \


Restart=no
Type=oneshot

@gloaming
Copy link
Contributor

gloaming commented Jul 10, 2019

Hm! Your one doesn't have the two spaces on the final line after the last \.
I guess this causes systemd to run the continuation over the two empty lines following.
Or did you run that output through an editor that stripped the trailing whitespace?

@gloaming
Copy link
Contributor

gloaming commented Jul 10, 2019

OK, I rebuilt my system using beff2f8d75e and it reproduces. The spaces in the unit file are intact.

systemd behaviour has changed, then; someone should find out whether this is a bug. Pinging @flokli @worldofpeace @fpletz - does anyone have an idea?

In any case, I think it would be better if the NixOS module didn't produce output like this.

@VlivesRaw hopefully you can work around it by configuring services.undervolt.tempBat, so that the last line is no longer only whitespace.

@VS-X
Copy link
Author

VS-X commented Jul 10, 2019

First of all thanks for the help!
When I tried again and copied by piping to xclip the spaces were there, so there's that. Honestly I'm not sure how to solve it, without some major changes to the code.
However I can tell that the service works completely fine without Restart="no" and Type="oneshot', especially considering that "Restart=no" is the default unit behaviour.

@worldofpeace
Copy link
Contributor

worldofpeace commented Jul 10, 2019

The issue here is #63533.

This was fixed upstream in systemd systemd/systemd#12890 and we've
backported those fixes to our fork in NixOS/systemd@bcbaa8d NixOS/systemd@aa4c4d3.

Pretty sure we updated systemd in nixpkgs to include that (#63784).

@flokli
Copy link
Contributor

flokli commented Jul 10, 2019 via email

@worldofpeace
Copy link
Contributor

@VlivesRaw If you need a quick patch #63777 should suffice until the channel advances.

@worldofpeace
Copy link
Contributor

Been resolved for a while now I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants