nvidia-persistenced.service conf does not make sense

Bug #1831352 reported by Jens Elkner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Nvidia
New
Undecided
Unassigned

Bug Description

The /lib/systemd/system/nvidia-persistenced.service from the nvidia-kernel-common-XXX doesn't make any sense and introducing another uid and gid is not needed at all. The documentation says, that the only purpose is to have a GPU client running, so that the GPUs do not get unloaded/uninitialized. So the user, who is actually running the service does not matter at all, but as usual, it should not be root - what is currently the case =8-( .

So to fix this flaw, one should a) use the DynamicUser directive and b) use the RuntimeDirectory directive to let systemd create and delete the on start/stop with proper permissions (and yes, the --user and --gid options as well as its runtime directory "management" of the nvidia-persistenced binary are IMHO completely useless, just overhead).

E.g. the following script works as expected (unless the bogus /lib/udev/rules.d/71-nvidia.rules wasn't fixed):

[Unit]
Description=NVIDIA Persistence Daemon
After=syslog.target

[Service]
Type=forking
PIDFile=/run/nvidia-persistenced/nvidia-persistenced.pid
DynamicUser=true
RuntimeDirectory=nvidia-persistenced
ExecStart=/usr/bin/nvidia-persistenced --verbose
TimeoutSec=60

[Install]
WantedBy=multi-user.target

BTW: The fix for /lib/udev/rules.d/71-nvidia.rules is:
    sed -i -e '/nvidia-persistenced/ d' /lib/udev/rules.d/71-nvidia.rules
Starting a service via udev trigger is a really, really, really bad idea!!!

Jens Elkner (jelmd)
information type: Proprietary → Public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.