If you are using the Intel XDK IoT Edition, the last loaded app will load at startup (aka what ever app is in the '/node_app_slot' directory). Even if you are not using the Intel XDK IoT Edition, placing a node.js app in '/node_app_slot' will make it run at startup. If you would like to make an app run at startup outside of the XDK mechanism, I recommend creating a systemd service (google 'systemd service' or use tutorials such as Getting Started with systemd)
[...] I recommend creating a systemd service (google 'systemd service' or use tutorials such as Getting Started with systemd)
you could also start inspecting the existing systemd service files /lib/systemd/system/*.service
If I've placed a file in /node_app_slot is there anything special that needs to be in it for it to start up at boot? I've placed a very simple node server that listens for Serial data in /node_app_slot and it isn't started on boot. I've also tried doing init.d scripts and systemd services to no avail. Any suggestions?
you need to have a package.json file with the 'main' js file specified. If the XDK daemon is disabled on you system, you will need to type 'systemctl enable xdk-daemon' and 'systemctl start xdk-daemon' to start the daemon.
below is a example of a minimal package.json (notice the 'main' field that specifies the 'entry point' into the node.js app you want to run)
For starters, thanks for the help people are trying to give, but up till now, I still didn't manage to start my node script at boot.
I have read the documentation on systemd, wrote a simple service:
I then performed the following commands:
systemctl enable /etc/systemd/system/myTestApp.service
even to check whether it works:
systemctl start myTestApp.service
But it simply won't work
Why is there no decent step by step documentation to do a thing that should be so elementary? Why do I have to read every single post in multiple threads just to make sure that I didn't miss anything. I am spending 2 days now on a simple motion detected triggering wave producing application, which in my opinion should be a walk in the park, but, no, not with edison...
OK, sorry for my part of documentation frustration...
I found my issue by reading the system log:
journalctl -u myTestApp.service
It appeared that the node dependencies were not correctly met:
The following lines were necessary in my service:
Once I have everything working, I will write a guideline so that people do not have to read every single post