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
sudo loginctl enable-linger ubuntu
solves issue but not sure it’s an elegant solution. – sunknudsen Aug 21 '23 at 21:34~/.config/autostart
directory instead of a systemd service? – user535733 Aug 21 '23 at 23:47linger
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