salve

ich möcht rechte in ein paar ordner in /sys/modules ändern, weil ich nachträglich optionen setzen will und sonst nicht bei allem darf.

der service schaut so aus:
[Unit]
Description=chmod /sys/module/i915/parameters
#Conflicts=shutdown.target

[Service]
Type=simple
ExecStart=/usr/bin/chmod ugo=640 -R /sys/module/i915/parameters/ ;  /usr/bin/chmod ugo=640 -R  /sys/module/iwlwifi/parameters/ ; /usr/bin/chmod ugo=640 -R  /sys/module/snd_hda_intel/parameters/

[Install]
WantedBy=graphical.target
und die fehlermeldung so:
[tom@frija ~]$ sudoedit /etc/systemd/system/chmod.service 
[tom@frija ~]$ sudo systemctl daemon-reload && sudo systemctl restart chmod.service
Failed to restart chmod.service: Unit chmod.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status chmod.service' for details.
[tom@frija ~]$ sudo systemctl restart chmod.service
Failed to restart chmod.service: Unit chmod.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status chmod.service' for details.
[tom@frija ~]$ sudo systemctl status chmod.service 
● chmod.service - chmod /sys/module/i915/parameters
   Loaded: error (Reason: Invalid argument)
   Active: failed (Result: exit-code) since Fr 2017-05-26 18:24:22 CEST; 19min ago
 Main PID: 1667 (code=exited, status=1/FAILURE)

Mai 26 18:33:44 frija systemd[1]: [/etc/systemd/system/chmod.service:7] Executable path is not absolute, ignoring: usr/bin/chmod 640 -R
Mai 26 18:33:44 frija systemd[1]: [/etc/systemd/system/chmod.service:8] Missing '='.
Mai 26 18:37:27 frija systemd[1]: [/etc/systemd/system/chmod.service:7] Executable path is not absolute, ignoring: usr/bin/chmod 640 -R
Mai 26 18:37:27 frija systemd[1]: [/etc/systemd/system/chmod.service:8] Missing '='.
Mai 26 18:38:18 frija systemd[1]: [/etc/systemd/system/chmod.service:7] Executable path is not absolute, ignoring: usr/bin/chmod ugo=640 -R
Mai 26 18:38:18 frija systemd[1]: [/etc/systemd/system/chmod.service:8] Missing '='.
Mai 26 18:39:41 frija systemd[1]: [/etc/systemd/system/chmod.service:7] Executable path is not absolute, ignoring: usr/bin/chmod ugo=640 -R
Mai 26 18:39:41 frija systemd[1]: [/etc/systemd/system/chmod.service:8] Missing '='.
Mai 26 18:42:47 frija systemd[1]: [/etc/systemd/system/chmod.service:7] Executable path is not absolute, ignoring: usr/bin/chmod ugo=640 -R
Mai 26 18:42:47 frija systemd[1]: [/etc/systemd/system/chmod.service:8] Missing '='.
 
was mach ich da falsch?
  • [gelöscht]

Simple Services können nur ein Kommando mit Argumenten unter ExecStart aufnehmen.
Was du suchst ist der Typ oneshot. Dort jedes (bei dir durch Semikolon getrennte) Kommando mit den zugehörigen Argumenten in jeweils einen ExecStart Eintrag packen. Diese werden in der Reihenfolge von oben nach unten ausgeführt.
  • [gelöscht]

PS:
[Unit]
Description=chmod /sys/module/i915/parameters
#Conflicts=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/bin/chmod ugo=640 -R /sys/module/i915/parameters/
ExecStart=/usr/bin/chmod ugo=640 -R  /sys/module/iwlwifi/parameters/
ExecStart=/usr/bin/chmod ugo=640 -R  /sys/module/snd_hda_intel/parameters/

[Install]
WantedBy=graphical.target
Ging gerade schlecht am Handy.
@schard
danke dir, jetzt passts 🙂

leider hilfts mir nichts, schreiben darf ich trotzdem nicht… auch als root nicht.
trotz angepasster rechte, warum ist das so?
/sys bzw. /proc beinhalten direkt vom Kernel verwaltete Variablen - wäre ja noch schöner, wenn Du da die Berechtigungen einfach ändern darfst. "root" ist König, aber der Kernel "Kaiser". 🙂