I've provisioned a bunch of RPis with a systemd service that runs an instance of chromium-browser in kiosk mode, but on a few seemingly random devices it doesn't run. I checked the status just by trying to enable it and I get
$ sudo systemctl enable kiosk.service
Failed to enable unit: Unit file /lib/systemd/system/kiosk.service is masked.
I looked up what it means for it to become "masked" in order to understand how this happened, and responses simply state that "the units are linked to /dev/null". Okay, but why did that happen to my service? ~~systemctl unmask kiosk.service will unmask my service but~~ (scratch that, see edit below) I'd like to make sure it doesn't continue to happen.
Here is the actual "kiosk.service" contents if relevant:
[Unit]
Description=Chromium Kiosk
Wants=graphical.target
After=graphical.target
[Service]
ExecStartPre=/bin/sleep 20
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/pi/.Xauthority
Type=simple
ExecStart=/bin/bash /home/pi/kiosk.sh
Restart=on-abort
User=pi
Group=pi
[Install]
WantedBy=graphical.target
EDIT:
Actually sudo systemctl unmask kiosk.service doesn't seem to do anything. When I do that then sudo systemctl enable kiosk.service it returns the same complaint that it's masked.
EDIT2:
So instead of succesfully being able to unmask I simply deleted lib/systemd/system/kiosk.service and re-subscribed it as a service, now it appears to remain enabled. Still have no idea why it was masked to begin with.