Boot from, node. js Script

Source: Internet
Author: User

#!/bin/bash### BEGIN INIT info# provides:xiyoulib# required-start: $all # required-stop: $all # default-start:2 3 4 AA Def ault-stop:0 1 6# short-description:start daemon at boot time# description:enable service provided by daemon.### END INIT info# chkconfig:345 08# description:forever for Node.jsdeamon=/home/wwwroot/default/im/chat.js #这里需要填写你自己的Node The startup script file for the project Log=/home/wwwroot/default/im/log/log #可选, the log file directory Pid=/home/wwwroot/default/im/log/pid #必填内容, Process number used to record forever export path= $PATH:/usr/local/bin #在这里指定一下Node的可执行程序安装目录, mine is/usr/local/binexport node_path= $NODE _ Path:/usr/local/lib/node_modules #这里是Node类库的路径 # The content will not be modified Node=nodeforever=forevercase "$" instart) $forever start -L $LOG--pidfile $PID-a $DEAMON; Stop) $forever stop--pidfile $PID $DEAMON;; StopAll) $forever stopall--pidfile $PID;; Restartall) $forever restartall--pidfile $PID;; Reload|restart) $forever restart-l $LOG--pidfile $PID-a $DEAMON; list) $forever list;; *) echo "Usage:/etc.init.d/node {start|stop|restart|Reload|stopall|restartall|list} "exit 1;; Esac

  

chmod 755 /etc/init.d/nodechkconfig /etc/init.d/node on


Reference: HTTPS://CNODEJS.ORG/TOPIC/5059CE39FD37EA6B2F07E1A3
http://news.rednode.cn/item/53f9988079dbd26f72f69686

Boot from, node. js Script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.