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
595 stars 65 forks source link

Command line options to your app.js #7

Closed morrisonbrett closed 9 years ago

morrisonbrett commented 9 years ago

Is there a way to pass command line options into the app?

e.g. $ sudo forever-service install myapp -s "myapp.js -myarg foo"

arvind-agarwal commented 9 years ago

There was no option till now. Based on your question, I have added a new command line option in 0.4.2; "-o", so now you can use it for passing arguments to the node script.

sudo forever-service install test --script main.js -o " param1 param2"
morrisonbrett commented 9 years ago

Perfect. Thx!

ravi-nextbit commented 8 years ago

It seems that specifying parameters with a leading dash are interpreted as option to forever-service. Trying to install a service with these options fails:

sudo forever-service install myservice -s index.js -r nodejs -o "-c /confdir"
=> error: unknown option `-c'

Workaround: add a leading space and it will be passed on as a normal parameter