0

Can’t figure out how to fix /system.slice/unsplashpi.service is not a snap cgroup error.

$ cat /etc/systemd/system/unsplashpi.service
[Unit]
Description=unsplashpi
After=multi-user.target

[Service] Type=forking ExecStart=/home/ubuntu/run.sh User=ubuntu WorkingDirectory=/home/ubuntu

[Install] WantedBy=multi-user.target EOF

$ cat /home/ubuntu/run.sh
#! /bin/bash

startx /home/ubuntu/unsplashpi.sh &> /home/ubuntu/startx.log &
$ cat /home/ubuntu/unsplashpi.sh
#! /bin/bash

DISPLAY=:0 firefox --kiosk --private-window --width 1080 --height 1920 "https://askubuntu.com" &

while :
do
  sleep 60
done
$ cat /home/ubuntu/startx.log
…
/system.slice/unsplashpi.service is not a snap cgroup
muru
  • 197,895
  • 55
  • 485
  • 740
  • Running sudo loginctl enable-linger ubuntu solves issue but not sure it’s an elegant solution. – sunknudsen Aug 21 '23 at 21:34
  • Are you open to using the ~/.config/autostart directory instead of a systemd service? – user535733 Aug 21 '23 at 23:47
  • Just wondering, why take the long route so the service runs under a normal user at the end? ... Won't a user service be a better fit for this task? ... Also It's not quiet obvious to me why linger would be needed in that situation, please see what's going on under the hood in a user login session regarding cgroups/scopes ...etc. https://askubuntu.com/a/1471031 which is rather too technical but might help. – Raffa Aug 22 '23 at 06:37

0 Answers0