eclipse-iofog/iofog-operator

Deploy controller with writable PID file directory

ctron opened this issue · 2 comments

ctron commented

The default PID file directory may not be writable, then the controller fails to start up:

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/iofogcontroller/src/iofog-controller.pid'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at Object.run (/usr/local/lib/node_modules/iofogcontroller/src/server.js:188:12)
    at jobs.forEach (/usr/local/lib/node_modules/iofogcontroller/src/server.js:127:31)
    at Array.forEach (<anonymous>)
    at Server.onStart (/usr/local/lib/node_modules/iofogcontroller/src/server.js:127:10)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at Server.emit (events.js:208:7)
    at emitListeningNT (net.js:1387:10)
    at _combinedTickCallback (internal/process/next_tick.js:136:11)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)

The path of the PID file should be configurable, or point to a dedicated PID file directory by default. The current default seems to be /usr/local/lib/node_modules/iofogcontroller/src/iofog-controller.pid, which may be immutable.

ctron commented

Here is a PR, which provides the configurable PID base: eclipse-iofog/Controller#714