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

Base path (-p PATH) not working #258

Open
jgoodall opened this issue Mar 7, 2012 · 9 comments · Fixed by #360
Open

Base path (-p PATH) not working #258

jgoodall opened this issue Mar 7, 2012 · 9 comments · Fixed by #360
Assignees

Comments

@jgoodall
Copy link

jgoodall commented Mar 7, 2012

Installing forever locally (not -g) and trying to set the log file on the CLI with the following command returns the following error:
$ ./node_modules/forever/bin/forever start -p pwd -l logs/forever.log -o logs/out.log -e logs/err.log --pidFile pids/forever.pid server.js
...
Error: ENOENT, no such file or directory '/path/to/home/.forever/logs/forever.log'

Isnt the -p PATH supposed to set the base for logs and pids, or am I misinterpreting that?

how come -l and -o/-e behave different with respect to their root?

Thanks.

@AvianFlu
Copy link
Contributor

AvianFlu commented Mar 8, 2012

The -l option is currently set to use the forever config path unless the value provided for -l starts with a /. For now, at least, this is expected behavior.

@AvianFlu AvianFlu closed this as completed Mar 8, 2012
@jgoodall
Copy link
Author

jgoodall commented Mar 8, 2012

Ok, but isnt setting the 'forever config path' done using -p? If so, it doesnt seem to be working for me. If not, is that possible? Thanks.

@AvianFlu AvianFlu reopened this Mar 8, 2012
@AvianFlu
Copy link
Contributor

AvianFlu commented Mar 8, 2012

I take it back, that option is actually broken. A workaround: forever set root /some/other/path will change the default forever root path. -p is supposed to be changing this, but isn't.

@ifeltsweet
Copy link

Why isn't this merged yet?

@xjamundx
Copy link

xjamundx commented May 4, 2013

The docs about -p say:
-p PATH Base path for all forever related files (pid files, etc.)

However the pid dir is clearly not set in the latest version of forever:
screen shot 2013-05-03 at 10 19 18 pm

@tjunnone
Copy link

tjunnone commented May 5, 2013

The -p option is still remains broken.
Forever always creates a ~/.forever directory with at least "config.json", "pids" and "sock" even if -p is given.

This is also a source of "forever list" not showing the processes type of errors: if HOME is not defined Forever will fail to read ~/.forever and fail to communicate with the monitor. Many upstart systems will run without a HOME env., so while Forever happily starts even if the directory cannot be created, you then cannot use the "list" or "stop" commands on the CLI.

@xjamundx
Copy link

xjamundx commented May 6, 2013

Exactly, that's the actual problem I'm having with it. I'm a weird environment without a HOME directory and it's not letting me stop or restart. I believe this is the source of the problem!

Here are 2 other weird bits:

Shouldn't it at least tell me it's trying to read logs from where I tell it logs will be?

screen shot 2013-05-06 at 8 29 29 am

Aren't I setting the root by using -p? How come it's not telling me any of the following:

  1. root: /tmp
  2. Reading config from xyz.json (so I can tell what's going on)
  3. Config is a read-only command and options will not be applied

screen shot 2013-05-06 at 8 31 40 am

@tomitrescak
Copy link

And still the issue in 2016 ;)

@bersling
Copy link

The -p flag isn't working, but what is working is to set the environment variable FOREVER_ROOT.

@kibertoad kibertoad reopened this Jan 16, 2019
@kibertoad kibertoad self-assigned this Jan 16, 2019
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