[erlang-questions] Priviliged ports and effective UID

Kevin q2h46uw02@REDACTED
Thu Oct 23 21:35:01 CEST 2008

Hello, I can't find an answer to this anywhere.  In erlang how does one deal with the problem of starting erlang as root, binding to a privileged port, and then change the effective user id to something other than root.

In a daemon process written in c or even perl, a process is started by an init script, which is run as root, it then binds to port, 25, 80, etc, and then it sets its effective UID and effective GID to something more harmless, like httpd/httpd.

I know you can start the whole thing like su httpd -c erl, but this doesnt allow for binding to prilileged port first.

And please don't tell me to use open_port() or write a linked in driver :-)


More information about the erlang-questions mailing list