Now that we have privilege dropping support, we need to apply further fixes to
the PID file handling.
Consider this situation:
1.) uMurmur is started as root
2.) It writes the PID file
3.) It drops privileges
4.) Eventually, uMurmur is killed
5.) uMurmur tries to unlink the PID file.
This will fail, since the PID file belongs to root :)
OTOH, if we don't unlink the PID file on shutdown, opening it with O_EXCL will
not be sufficient to prevent multiple uMurmur instances from running (since the
open would just fail).
Another way to prevent multiple instances is to lock the PID file while uMurmur
is running -- which is what this patch does.
Note that we still try to unlink the PID file on shutdown -- it doesn't do no
harm either way :)
Original issue reported on code.google.com by tilm...@googlemail.com on 23 Jan 2011 at 4:10
Original issue reported on code.google.com by
tilm...@googlemail.com
on 23 Jan 2011 at 4:10Attachments: