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

Cant make forever log options work #10

Closed vongohren closed 9 years ago

vongohren commented 9 years ago

Hi im trying to add forever log options in my forever options. But it seems to not be working.

This is my install line:

sudo forever-service install serialReader --script serialReader.js -f " -watchDirectory /home/pi/Code/arduino-plant-reader -w -l readerLog.log -a"

Also, is there a reason to use both watchDirectory and -w? Wouldnt -w just work alone?

arvind-agarwal commented 9 years ago

forever-service overrides the log option and stores all logs in /var/log/{service}.log (in this case /var/log/serialReader.log) file hence specifying -l will not work. Logrotate script is also automatically set to rotate this log file.

I am not sure on -w and --watchDirectory together, I think I picked up example from somewhere and I have been able to successfully use it in my project so haven't tried to further investigate that.

vongohren commented 9 years ago

Ok but you are using it together? I usually just use -w when i launch forever from the directory im in. But how does that work when you use the service? Does it launch from /etc/init.d/ folder?

arvind-agarwal commented 9 years ago

forever-service will change to the same directory from which you run forever-service install cmd before invoking forever command, so if -w works from that directory it should work.

vongohren commented 9 years ago

-w works, but how would .foreverignore work? Since it runs from same folder and all it works normally?