Open ppar opened 7 years ago
"simply reusing" is not really possible as the socket can be owned by another process.
Apparently it's the server.ListenUnixgram() call that fails if the socket already exists, whether's it's in use or not - so the consistent behavior here would be to just fail hard and terminate startup if this happens.
Same for the .ListenTCP() and .ListenUDP() calls in Consume(), it doesn't look like their failures abort startup either.
Removing the socket at shutdown like consumer.Socket seems to do solves the idempotency problem anyway.
We could change this to "don't startup" now as config errors will always stop gollum from starting, but this has to be consequently fixed in all other plugins, too.
Agreed.
If the configuration specifies a UNIX domain socket, and this socket already exists in the filesystem, consumer.Syslogd will fail with
[2017-07-24 00:26:19 CEST] ERROR Failed to open unix:///tmp/gol.sock PluginID=SyslogdConsumer PluginType=consumer.Syslogd
instead of simply reusing the existing socketIn the above situation, despite the "Error" during startup, Gollum doesn't terminate.
When shutting down, consumer.Syslogd doesn't remove this socket from the filesystem
Specifying a UDP or TCP transport for a protocol that only supports the other causes a "Warning" instead of a fatal error and termination.
When listening on a UNIX socket and running with Format: "RFC5424" or "RFC6587", transmitting a message with
logger -u /tmp/gol.sock dadwqewqe123213123
[1] produces only an empty string in the Gollum message. Test results of all formats and transports:[1] Debian 9 x86_64,
logger
frombsdutils 1:2.28.2-1