zapty / forever-service

Provision node script as a service via forever, allowing it to automatically start on boot, working across various Linux distros and OS
https://github.com/zapty/forever-service
MIT License
594 stars 65 forks source link

How to restart service? #81

Open ngohuunam opened 7 years ago

ngohuunam commented 7 years ago

How to stop and start nodejs.js file again, in case of modify nodejs.js file?

Thks

arvind-agarwal commented 7 years ago

You can use the start and stop service commands, the nodejs files can be changed any number of times since everytime service starts it uses the latest script file found in the same location.

ngohuunam commented 7 years ago

is it $ sudo forever-service stop test than $ sudo forever-service start test ? sorry for my bad

arvind-agarwal commented 7 years ago

when you install the service you will get exact commands in console that time, usually it would be sudo service servicename start / stop

ngohuunam commented 7 years ago

Sorry I tried some times, but unfortunatly, it did't work, totally because my zero knowledge about linux, could you please teach me step by step? my service name: mynode. How I can stop and start again service to run newest nodejs file? thanks

yogeshwar607 commented 7 years ago

@ngohuunam , you can use following commands for your case. sudo service mynode start sudo service mynode stop sudo service mynode restart sudo service mynode status

arvind-agarwal commented 7 years ago

@jm93 forever service is primarily designed to provision service for a given platform. The commands to control service are specific to a platform and not generic. When you provision a service using forever-service these commands are clearly displayed.

jm93 commented 7 years ago

thanks for getting back

so I tried: sudo forever-service install test --script server.js --start

and looks like it worked, I can get it from sudo forever list.

I'll delete my last comment if I can

vikas0121 commented 6 years ago

Hi, i'm deploying the rocket chat application and want to use secondary MongoDB to read. while setting the MONGOURL in the forever service export MONGO_URL=mongodb://10.xx.xx.xxx:27017,10.xx.xx.xxx:27017/Chat?replicaSet=rs1&readPreference=nearest not working for me..help needed This is a Meteor.js application.

arvind-agarwal commented 6 years ago

What is not working exactly? Please provide exact command you are using to provision forever-service. And exact details and relevant logs related to the error.


From: vikas notifications@github.com Sent: Saturday, October 7, 2017 10:24:09 PM To: zapty/forever-service Cc: Arvind Agarwal; Comment Subject: Re: [zapty/forever-service] How to restart service? (#81)

Hi, i'm deploying the rocket chat application and want to use secondary MongoDB to read. while setting the MONGOURL in the forever service export MONGO_URL=mongodb://10.xx.xx.xxx:27017,10.xx.xx.xxx:27017/Chat?replicaSet=rs1&readPreference=nearest not working for me..help needed This is a Meteor.js application.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/zapty/forever-service/issues/81#issuecomment-334949710, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIDgWxIAHJhqYIe-VsGnydzJZWy5kZSjks5sp6yxgaJpZM4KkDM7.