socket: if RemoveOnStop= is turned on for a socket, try to unlink() pre-existing...
authorLennart Poettering <lennart@poettering.net>
Wed, 27 Sep 2017 15:48:28 +0000 (17:48 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 27 Sep 2017 15:53:00 +0000 (17:53 +0200)
commit22b20752e20ce0e637083067b450f61cf4acf691
tree4af63b23dc0199c977b1930eaf28cf75d0fd1eab
parent3ecc7fc3e631d1f5de7bd0913227ae2f2e8f8929
socket: if RemoveOnStop= is turned on for a socket, try to unlink() pre-existing symlinks

Normally, Symlinks= failing is not considered fatal nor destructive.
Let's slightly alter behaviour here if RemoveOnStop= is turned on. In
that case the use in a way opted for destructive behaviour and we do
unlink all sockets and symlinks when the socket unit goes down. And that
means we might as well unlink any pre-existing if this mode is selected.

Yeah, it's a bit of a stretch to do this, but @OhNoMoreGit is right: if
RemoveOnStop= is on we are destructive regarding any pre-existing
symlinks on stop, and it would be quite weird if we wouldn't be on
start.
src/core/socket.c