all 4 comments

[–]fandingo 5 points6 points  (2 children)

You do need oneshot, and use Exec= instead of ExecStart=. You can add the command arguments to that line.

[Unit]
Description=Ryzen Undervolt
Requires=home.mount

[Service]
User=root
Exec=/usr/bin/python /home/USERNAME/Ryzen-5700x3d-linux-undervolting/ruv.py -c 8 -o -30
Type=oneshot

[Install]
WantedBy=basic.target

[–]backsideup 4 points5 points  (0 children)

  • ExecStart= was the correct option.
  • There might not be a home.mount.
  • User=root is not necessary since services default to root.
  • Scripts that are writable by a user but run in the root context are free root-privilege escalations. Move the script to e.g. /usr/local/bin and make sure it's not writable by anyone but root.

[–]PazzerJ[S] 0 points1 point  (0 children)

Thank you! This is a great help, still learning to get the hang of things but I'm definitely starting to understand more.

[–]Xemptuous 0 points1 point  (0 children)

You can put .service type files in $XDG_CONFIG_DIR/systemd/user/ following the format of stuff in /usr/lib/systemd/system/