1. Step first create xyz.conf file into /etc/init/ and put your script.
example : let me start node server on start up
description "test job"
start on runlevel [2345]
exec node /path/of/your/file/script.js
2. Save this file.
3. now type command sudo service xyz start. Node server will start.
You can stop it with stop command and restart with restart command.
example : let me start node server on start up
description "test job"
start on runlevel [2345]
exec node /path/of/your/file/script.js
2. Save this file.
3. now type command sudo service xyz start. Node server will start.
You can stop it with stop command and restart with restart command.
No comments:
Post a Comment