【问题标题】:How to run command when reboot my Centos server重新启动我的 Centos 服务器时如何运行命令
【发布时间】:2013-10-15 11:07:23
【问题描述】:

我的服务器重启一次后我将运行一个命令

我的服务器上有 node.js 的聊天应用程序

这是我用 putty 编写并运行我的聊天应用程序的命令行

登录服务器

[root@name ~]# cd /
[root@name /]# cd /home/admin/domains/mydomain.com/public_html/chat_server
[root@name chat_server]# forever start websocket.js
info:    Forever processing file: websocket.js
[root@name chat_server]#

如何自动运行?

【问题讨论】:

    标签: linux node.js centos


    【解决方案1】:

    您正在寻找rc.local 脚本。见here

    【讨论】:

    • 嗨,亲爱的,如何添加到 rc.local 对不起,我是初学者
    • 嗯,这是一个简单的 shell 脚本...您可以根据需要调整它!从我发布的链接:Adding commands to the bottom of this script is an easy way to perform necessary tasks like starting special services [...]
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-09
    • 1970-01-01
    • 1970-01-01
    • 2018-11-20
    相关资源
    最近更新 更多