Ruby script won't terminate when run with sudo

I have a script that binds a socket to a port. It needs root privileges
to do this. The problem is if I run it as root, then if I want to
terminate the script, I have to run pkill as root. I understand that
this is because the process “ruby” is owned by root, not by me.

Is there an easy way to give the script root privileges without allowing
root to own the process?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs