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

Running forever as another user with sudo appears to ignore log file parameters #196

Closed
markbao opened this issue Dec 17, 2011 · 2 comments

Comments

@markbao
Copy link

markbao commented Dec 17, 2011

Tested on node 0.6.5 and 0.4.12.

Running forever using sudo -u appears ignore the specified log file parameters.

+ sudo -u app /usr/local/bin/forever start -p /logs -l /logs/forever.log -o /logs/out.log -e /logs/err.log server.js
The "sys" module is now called "util". It should have a similar interface.
info�:   Forever processing file: �server.js�

{
  "process": {
    "pid": 11307,
    "uid": 1000,
    "gid": 1000,
    "cwd": "/srv/synapse",
    "execPath": "/usr/local/bin/node",
    "version": "v0.6.5",
    "argv": [
      "node",
      "/usr/local/bin/forever",
      "start",
      "-p",
      "/logs",
      "-l",
      "/logs/forever.log",
      "-o",
      "/logs/out.log",
      "-e",
      "/logs/err.log",
      "server.js"
    ],
    "memoryUsage": {
      "rss": 18210816,
      "heapTotal": 14161088,
      "heapUsed": 7707424
    }
  },
  "os": {
    "loadavg": [
      0.19287109375,
      0.05517578125,
      0.0107421875
    ],
    "uptime": 3449.821602155
  },
  "trace": [],
  "stack": [
    "Error: EACCES, permission denied '/root/.forever/n6v2.log'"
  ],
  "level": "error",
  "message": "uncaughtException"
}
@indexzero
Copy link
Member

This is fixed in forever@0.8.x. The permission denied here is expected, but you can see it's trying to get to /logs not /root/.forever

$ sudo -u Charlie forever -p /logs -l /logs/forever.log -o /logs/out.log -e /logs/err.log examples/server.js -p 8080
{
  "process": {
    "pid": 5069,
    "uid": 501,
    "gid": 20,
    "cwd": "/Users/Charlie/Nodejitsu/forever",
    "execPath": "/usr/local/bin/node",
    "version": "v0.6.6",
    "argv": [
      "node",
      "/Users/Charlie/.local/bin/forever",
      "-p",
      "/logs",
      "-l",
      "/logs/forever.log",
      "-o",
      "/logs/out.log",
      "-e",
      "/logs/err.log",
      "examples/server.js"
    ],
    "memoryUsage": {
      "rss": 21553152,
      "heapTotal": 14445696,
      "heapUsed": 9195328
    }
  },
  "os": {
    "loadavg": [
      0.30810546875,
      0.515625,
      0.5595703125
    ],
    "uptime": 1389428
  },
  "trace": [],
  "stack": [
    "Error: EACCES, permission denied '/logs/forever.log'"
  ],
  "level": "error",
  "message": "uncaughtException"
}

@markbao
Copy link
Author

markbao commented Jan 6, 2012

Thanks, Charlie.

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

No branches or pull requests

2 participants