taskd.pl: be persnickety about preexisting sockets
Previously taskd.pl would just blindly unlink any preexisting
socket before attempting to bind. This is bad as it allows a
previous taskd.pl to keep running while not receiving any new
connections.
Also, during graceful restart, an open listen socket could be
passed along that did not match the actual socket node in the
filesystem which is also bad as the new, gracefully-restarted
instance would be unable to receive any new connections.
Continue to allow any unix stream listen socket in --inetd mode,
but now in non-inetd mode:
1) Ignore any incoming listen socket for a graceful restart if
the socket is not located where its supposed to be or its
inode doesn't match the inode of the socket file at that location.
2) Refuse to unlink anything but a pre-existing socket at the
expected location when not gracefully restarting and furthermore,
refuse to unlink an existing socket if it's still "live".
Also now use the "realpath" function when comparing socket paths to
make sure sockets are not incorrectly rejected.
With these changes only one taskd instance (per Girocco instance)
should ever be running at a time.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>