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

Deploy as non root user #7

Open
andreareginato opened this issue Jul 26, 2013 · 0 comments
Open

Deploy as non root user #7

andreareginato opened this issue Jul 26, 2013 · 0 comments

Comments

@andreareginato
Copy link
Contributor

The deploy of mqtt is made as root but it should be as deploy user.
The code that should make this possible is the following one, but it does not work.

app.on('ready', function() {
  debug('MQTT Server listening on port', process.env.NODE_PORT)

  if (process.getuid() === 0)
    require('fs').stat(__filename, function(err, stats) {
      if (err) return console.log(err)
      process.setuid(stats.uid);
    });
});
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

1 participant