I've read that, in fact that's what I used that got me away from using init.d scripts. My script works fine but it does not allow my service to persist. I have enabled my service with
systemctl enable service
and it does run on boot but it also exits immediately and so isn't doing what I need it to do.
To make a script that continues to be executed the general command would be systemctl enable service. If you are not getting the output correctly maybe you can check the status option of systemctl to see what may be wrong.
Take a look at these links:
- systemctl enable hostapd
- /usr/bin/node /home/root/server.js &
independent on your issues: you shouldn't put "systemctl enable <xyz>" in that script I'd say. The enabling is a one time enabling.
You shouldn't put the server.js in background unless you tell systemd it's a daemon I'd say.
Maybe take a look at /lib/systemd/system/xdk-daemon.service how it's done there