Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the pidFile option working #421

Open
catamphetamine opened this issue May 10, 2013 · 13 comments
Open

Can't get the pidFile option working #421

catamphetamine opened this issue May 10, 2013 · 13 comments

Comments

@catamphetamine
Copy link

Hello.
I'm using the cli tool like this:

forever --pidFile ~/processes/node.js.pid -c coffee ~/repository/code/web/main.coffee    

And it doesn't create the pid file (the ~/processes directory is empty).
Is there something wrong with this console command or is it a bug?

@evgeny-goldin
Copy link

Try instead

 forever -p ~/processes/ --pidFile node.js.pid

@catamphetamine
Copy link
Author

Already tried this.
Still no pid file.

@evgeny-goldin
Copy link

Make sure you run the latest forever version. Here's my full command, perfectly working:

./node_modules/.bin/forever start -p /home/evgenyg/.forever --pidFile hello-coffee-port-number-3086.pid --minUptime 5000 --spinSleepTime 5000 ./node_modules/.bin/coffee server.coffee

Or could be that application being started cannot start so no PID file is created.

@catamphetamine
Copy link
Author

When I run it like you said:

forever start -p /home/sociopathy/processes --pidFile test.pid --minUptime 5000 --spinSleepTime 5000 coffee ~/repository/code/web/main.coffee

It fails with this message

info:    Forever processing file: coffee
error:   Cannot start forever
error:   script /home/sociopathy/coffee does not exist.

@xjamundx
Copy link

The -p option is broken as per #414

@egmont1227
Copy link

for me, --pidFile is working as expected in v0.10.9

@catamphetamine
Copy link
Author

got it working today.
my command is:

NODE_ENV=development forever start -p ~/node --pidFile ~/node/process.pid --colors --watch --watchIgnore -l log/forever.txt --append -o log/output.txt -e log/errors.txt -c coffee main.coffee

and

forever stop main.coffee

and .foreverignore:

log/*
process.pid

@guss77
Copy link

guss77 commented Apr 29, 2014

This indeed worked for me, but only after I specified both -p with the full path and --pidFile with the full path.

The following do not work, but according to the documentation it should work and that means the bug was not fixed:

  • not using -p
  • -p with absolute path and --pidFile with relative path

@GuyMograbi
Copy link

Wow guys, thank you so much!! This thread resolved so many bug-like errors for me.
it seems I have been using forever script.js without specifying start, and pidFile didn't work, and it didn't run like daemon and other stuff. Your thread really helped.

Personally I think forever script.js should run the same as if I wrote forever start script.js.
currently it does not and I am quite sure this should be declared a bug.

it causes people to add & at the end - a solution a lot of people know when they want daemon instead of getting built in solution from forever.. which is a shame.

instead I would add something else - like run which will cause it to run as a non-daemon process. so I will write forever run script.js..

@fresheneesz
Copy link

@kuchumovN You did not get the --pidFile argument working. All you did was use -p to set the base directory. Forever is still ignoring the pidFile option. Please reopen this issue as its still a bug.

@catamphetamine
Copy link
Author

Well, okay, if you say i should - i will, no prob

@akhoury
Copy link

akhoury commented Nov 16, 2018

no updates since 2015?

@guss77
Copy link

guss77 commented Nov 16, 2018

This project had no updates since 2016, so it should be safely considered dead.
If you need to keep a service alive, I suggest deploying it as a SystemD service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants