Initialize and monitor electron app via `systemd` at system startup


We have some kiosks (unmanned) and we’re using electron as the front end of them (Running on Ubuntu 16.04).

My question is on how to handle automatic launching of electron at startup via systemd (or similar init system).

Right now, my ux.service file looks like this:

Description=Kiosk UX service

ExecStart=/usr/local/lib/npm/bin/electron /home/myuser/dev/kiosk-ux



But not starting it at boot time. Any idea of what am I missing?


p.s. Once started (manually through sudo systemctl start ux.service, it does run it and monitors its running state (restarts if I kill the elctron process), but it doesn’t start it at boot time.


This sounds like a systemd question, not an Electron question. Are you able to start other applications through that method?


Me too,

My electron app just won’t start!

But I have found that, the similar VNC server service script will. I just don’t know why?


Description=VNC Server in Service Mode daemon

ExecStart=/usr/bin/vncserver-x11-serviced -fg
ExecReload=/bin/kill -HUP



Can anyone succeed in getting electron app work with systemd? I am struggling with same issue now. :frowning: Any help would be greatly appreciated.