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

If creation of ~/.forever fails, no error but CLI stops working (i.e. forever list says "No forever processes running") #415

Closed
tjunnone opened this issue May 5, 2013 · 12 comments · Fixed by #1017

Comments

@tjunnone
Copy link

tjunnone commented May 5, 2013

If ~/.forever cannot be created while starting as a daemon (and it always tries to, see issue #414), the daemon still starts and everything looks OK and there's nothing to indicate the failure in the logs.

After this however, "forever list" will give: "No forever processes running".
"forever stop" will give: "Forever cannot find process with index: myScript"

I noticed this because when I start Forever from a init script, there's no HOME environment and it tries to write to /root/.forever which it doesn't have permissions for. In addition to obeying the -p parameter, I think there should be an error in the log and perhaps the daemon should even fail to start since it becomes uncontrollable from the cli.

@indexzero
Copy link
Member

This feels like a duplicate of #544 and may be related to the root cause of all the empty log files.

@indexzero indexzero changed the title If creation of ~/.forever fails, no error but CLI stops working If creation of ~/.forever fails, no error but CLI stops working (i.e. forever list says "No forever processes running") Dec 15, 2015
@indexzero
Copy link
Member

Duplicate of #483.

@xprt64
Copy link

xprt64 commented Feb 17, 2016

I had the same issue: I added an init script that started a node.js application with PM2 but pm2 list showed no application running although ps aux | grep node listed the process correctly.
The solution in my case was to start the init script AFTER the network; I think the sockets were needed for communication between pm2 instances .
This is my working init script (notice $network at Required-Start line):

#! /usr/bin/php
<?php
#
### BEGIN INIT INFO
# Provides:          crm
# Required-Start:    $remote_fs $syslog $network $mysql $apache2 $cron $pm2
# Required-Stop:     $remote_fs $syslog $network $mysql $apache2 $cron $pm2
# Should-Start:      $network $time
# Should-Stop:       $network $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description:  blah blah blah
# Description:       blah blah blah 
### END INIT INFO
#


require 'startup.php';

@swapnilgt
Copy link

Any solutions for this yet?

@JulianNorton
Copy link

3 years later, still an issue.

@petercunha
Copy link

Please fix this...

@meherchandan
Copy link

Any update on this one? I am still facing this issue

@kibertoad
Copy link
Contributor

Will check it today, sorry!

@kibertoad
Copy link
Contributor

@meherchandan @tjunnone @petercunha Please review #1017

@petercunha
Copy link

Thank you! @kibertoad

@kibertoad
Copy link
Contributor

New version is out with a fix!

@kentaguilar
Copy link

kentaguilar commented May 8, 2021

A fix would be great for this.
Encountered this one as well.
What I could recommend for now is to find the process that's using your node port e.g. 3000. Like so,
sudo lsof -t -i:3000

That command will show the process id. Then perform,

kill PID

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

Successfully merging a pull request may close this issue.

9 participants