Systemd node app failing to start

后端 未结 2 652
醉酒成梦
醉酒成梦 2021-01-29 00:34

I have a node app, that I\'m trying to add as a service, the app works fine if I go to the directory where it\'s installed and do node start.js however when I do

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 01:05

    Contrary to a popular misconception, systemd is very different from traditional Unix concept of init scripts. It is explained in much more detail here and here. I have noticed that a lot of people here are asking about problems with running Node with systemd and they rarely get any solutions. My recommendation would be to use traditional SysV init scripts or Upstart that also works with no surprises whenever you see that you cannot do something with systemd. I have never seen situations where a Node application couldn't be easily run with Upstart or SysV init scripts but I've seen problems with systemd. I've heard that it is especially problematic with clustering and other more complicated deployment scenarios. Just follow the Unix philosophy and use simple tools that do one thing and do it well. Init scripts are not that complicated.

    See also:

    • create systemd nodejs express-generator

提交回复
热议问题