productionization of edge micro: running micro gateway under systemd

Not applicable

im having a really fun time getting systemd and edge micro to work together.

The crux of the problem is that while one starts the whole process off with this command:

cd /opt/edgemicro/agent; /usr/local/bin/node build/src/index.js

two PIDs are generated from this. One for

/opt/edgemicro/agent/build/src/index.js

and the other for

/opt/edgemicro/gateway/index.js

Does anyone have any pointers on how to get the second PID to be killed ? Ive built a pretty good init.d script that SHOULD do this - but systemd takes over for start and stop functions and it seems as if my code is just being ignored...

1 3 278
3 REPLIES 3

Not applicable

hahah - sometimes you get stuck in a specific way of thinking and get blinded to the fact that your solution is right in front of you.

If anyone has an answer for this please go ahead and post it. Otherwise once I figure out systemd (and stop trying to fit the old init.d scripts into it) ill post the obvious one...

We will also get away from two process model so that it's easier to automate using setup like you have and containerize. Stay tuned.

So we are finding that with systemd the two process model isnt the end of the world. I havnt figured out if process MONITORING is going to be as easy as it should - but at least this isnt a disaster.

The problem we were having was that PM2 and init.d scripts are sort of a pain to manage w/ two processes. Worse: init.d scripts running in RHEL/CENTOS/OL 7.1 which really uses systemd.

Moving to pure systemd seemed to make things a lot better.