Quantcast
Viewing all articles
Browse latest Browse all 4852

Beginners • Re: Systemd, gpiozero, permissions - boot vs shell

I also have a similar `No access to /dev/mem` error with my user service (managed using `systemctl --user` command).
That suggest that at the time your service starts the /dev/gpio* device nodes do not exist. If that is the case running ti as root likely won't help.

Try to find which service or target creates them and add that to your service as a dependency.
I agree with this but have no idea about which service or target my service should depends on.

My current workaround is to add the service below.
~/.config/systemd/user/delay.service:

Code:

[Unit]Description=delay[Service]Type=oneshotExecStart=/bin/sleep 20[Install]WantedBy=default.target
And add the following lines.
~/.config/systemd/user/my_service_requires_dev_mem.service:

Code:

[Unit]After=delay.service
Note `sleep 10` is not enough for my case.

I've not tested yet but using `.timer` might be a better solution.

Statistics: Posted by c3_x_pop — Sun Nov 24, 2024 9:05 am



Viewing all articles
Browse latest Browse all 4852

Trending Articles