3 Replies Latest reply on Apr 24, 2015 11:20 AM by Intel_Peter

    Running Node.js as system service, problem with Cylon.js


      I've made a node.js script to run a robot. The script itself runs fine, but if I want to use it as a service, then it always fails. The following code starts the problem:



      var app = require('express')();

      var http = require('http').Server(app);

      var io = require('socket.io')(http);


      var Cylon = require('cylon');


      //The following part kills the servive

      var rbt=Cylon.robot({

        connections: {

          edison:{adaptor: 'intel-iot'}



        devices: {

          servoL: { driver: 'servo', pin: 20 },

          servoR: { driver: 'servo', pin: 14 },

          button: { driver: 'button', pin: 15 },






      Description=robotserver startup





      ExecStart=/bin/sh -c "/usr/bin/node /home/root/robotServer/index.js"







      And I've executed the following commands:

      systemctl daemon-reload

      systemctl start robotserver.service


      If I run "systemctl status robotserver.service", the following message will show up:

      ● robotserver.service - robotserver startup

        Loaded: loaded (/etc/systemd/system/robotserver.service; static)

        Active: activating (auto-restart) (Result: exit-code) since Thu 2015-03-12 13:48:57 UTC; 7s ago

        Process: 2846 ExecStart=/bin/sh -c /usr/bin/node /home/root/robotServer/index.js (code=exited, status=143)

      Main PID: 2846 (code=exited, status=143)


      Anybody knows what's wrong with my code?