Ratchet does not clearly indicate need for elevated privilege
msakrejda opened this issue · 2 comments
msakrejda commented
Ratchet needs to run as the user that is running the Postgres cluster. If started as an unprivileged user, it gives an unrelated and seemingly incorrect error:
heroku@1.2.3.4:/tmp/ratchet$ ./ratchet nap --port=5432 15
Could not resolve port None to a PID
Ideally, this should give an error regarding insufficient permissions.
fdr commented
root user is also an acceptable one here, although in general least-privilege seems the best.
I think a 'hint' message may be best, but also it is possible to determine for ports > 1024 if they are bound or not (at the very least, one could just call listen()
. In that case, the hint can be even more detailed ("the port is taken, but I can't figure out the pid, are you sure you are using a user with the right perms?")