node.jsbashssharduinointel-galileo

Error setting sh script at startup - Intel Galileo Gen 1


I have running a node webserver on Intel Galileo Gen 1 and a normal arduino sketch which saves data from UDP messages.

I've tried to use the call system to set the timezone, date and start the webserver, but doesn't work very well. Then I created a sh script with the same commands, and created the corresponding links to the file in "/etc/init.d" using "update-rc.d startServer.sh defaults".

export TZ=CET-1CEST,M3.5.0,M10.5.0/3   
rdate 132.163.4.101 && hwclock --systohc
node /media/mmcb1k0p1/Server/server2.js 

It works, but Galileo does not start ssh, since I cannot connect anymore if it's running + sometimes the arduino sketch is not running. It seems like Galileo is currently executing the webserver and waits for it to finish to execute the rest, like an active process, instead of working in background.

Any help?


Solution

  • Run the node server as a background process:

    node /media/mmcb1k0p1/Server/server2.js &
    

    Note the & at the end.