The early dropping of root privileges as introduced with #18 does not work for me, as binding an interface requires root. Without it mdns-repeater reports an error:
mdns-repeater: send setsockopt(SO_BINDTODEVICE): Operation not permitted
This PR delays the dropping of the root privileges and moves daemonize() post the opening of the sockets to ensure the pid file is created for the same user that is expected to unlink() it on shutdown.
The early dropping of root privileges as introduced with #18 does not work for me, as binding an interface requires root. Without it mdns-repeater reports an error:
mdns-repeater: send setsockopt(SO_BINDTODEVICE): Operation not permitted
This PR delays the dropping of the root privileges and moves daemonize() post the opening of the sockets to ensure the pid file is created for the same user that is expected to unlink() it on shutdown.