On an amazon linux instance, I have two scripts called start_my_app
and stop_my_app
which start and stop forever (which in turn runs my node.js app).
(在亚马逊linux实例上,我有两个名为start_my_app
和stop_my_app
脚本,它们永远启动和停止(后者又运行我的node.js应用程序)。)
I use these scripts to manually start and stop my node app. (我使用这些脚本手动启动和停止我的节点应用程序。)
So far so good. (到现在为止还挺好。)
My problem: I also want to set it up such that start_my_app
is run whenever the system boots up.
(我的问题:我也想设置它, start_my_app
在系统启动时运行start_my_app
。)
I know that I need to add a file inside init.d
and I know how to symlink it to the proper directory within rc.d
, but can't figure out what actually needs to go inside the file that I place in init.d
. (我知道我需要在init.d
添加一个文件,我知道如何将它符号链接到rc.d
的正确目录,但是无法弄清楚我在init.d
放置的文件中究竟需要什么。 。)
I'm thinking it should be just one line, like, start_my_app
, but that hasn't been working for me. (我认为它应该只是一行,比如, start_my_app
,但这对我start_my_app
。)
ask by meetamit translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…