[sudo-access] help with doorjam autostart

Jake jake at spaz.org
Wed Oct 7 03:25:52 PDT 2015


ok i worked on the front door a lot and i got it physically decent with 
the electric strike now working.

replaced the fried arduino, and made a DC power cable to the USB hub since 
the 5V line on the beaglebone black got fried when the arduino got fried, 
when the people taking out the old door presumably ripped everything out.

i changed the serial device name in index.js for doorjam, but for whatever 
reason it doesn't autostart.  if i run node index.js from the commandline 
it works!  but psy log doorjam returns nothing, ever, because psy is not 
running it.  why?  I don't know.  who knows?

when i run /etc/init.d/doorjam start, it says

root at omnidoor:/etc/init.d# ./doorjam start
Starting doorjam (via systemctl): doorjam.serviceJob failed. See system journal and 'systemctl status' for details.
  failed!

so i edited /etc/init.d/doorjam to refer only to /root/doorjam/index.js 
and NEVER to /opt/doorjam which I renamed so people stop using it already. 
nobody uses /opt ok

so i tried this:

psy start --logfile /var/log/doorjam.log --name doorjam -- node /root/doorjam/index.js

and then in another window i ran psy log doorjam, here's what it said:

!!! PROCESS SPAWN: PID 1422

module.js:340
     throw err;
           ^
Error: Cannot find module '/opt/doorjam/index.js'
     at Function.Module._resolveFilename (module.js:338:15)
     at Function.Module._load (module.js:280:25)
     at Function.Module.runMain (module.js:497:10)
     at startup (node.js:119:16)
     at node.js:902:3
!!! PROCESS EXIT: 8
!!! PROCESS SLEEP

over and over and over again.  why is it looking for /opt/doorjam/index.js 
?????????????????/  i don't know, my psy command (above) did not mention 
opt.

so i ran screen, and in screen i ran "node index.js" and it's working.

fix it.

oh, don't forget our git branch is "oldstyle" not master

-jake


More information about the access mailing list