As many people, i'm looking to use my pi as a kiosk. I have managed to get everything running when starting the kiosk.
my kiosk.sh script, which works fine
#!/bin/bash
URL="http://127.0.0.1"
xset s noblank
xset s off
xset -dpms
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
unclutter -idle 0.5 -root &
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk $URL &
I am able to autostart this script thorugh /etc/xdg/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splash
point-rpi
@bash /home/pi/kiosk/kiosk.sh
However, when I try the same using a unit file, that does not work. I commented out the last line of autostart before starting the service
[Unit]
Description=Chromium Dashboard
Requires=graphical.target
After=graphical.target
[Service]
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/pi/.Xauthority
Type=simple
ExecStart=/home/pi/kiosk/kiosk.sh
Restart=on-abort
User=pi
Group=pi
[Install]
WantedBy=graphical.target
this is the output of systemctl status pi@kiosk.service
● pi@kiosk.service - Chromium Dashboard
Loaded: loaded (/etc/systemd/system/pi@kiosk.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2019-10-21 20:38:56 CEST; 2s ago
Process: 1417 ExecStart=/home/pi/kiosk/kiosk.sh (code=exited, status=0/SUCCESS)
Main PID: 1417 (code=exited, status=0/SUCCESS)
Oct 21 20:38:55 countdown systemd[1]: Started Chromium Dashboard.
Oct 21 20:38:56 countdown systemd[1]: pi@kiosk.service: Succeeded.
so I would like to know where I am going wrong here. I should get the same response both ways but I dont.