Closed Nemo157 closed 9 months ago
I wonder if it should unlink on startup. Since we exec
there is not really a good way to shut down unless I keep a separate process around.
Hmmm, I would like if it errored if something else was using the socket (like in the above example I was replacing a systemd
managed socket for testing, so if I forgot to systemctl stop
it); but if there's not a nice way to do that I guess force overwriting it would be fine. Maybe with a --force
flag to make it explicit?
I think the most common way to do this would be to delete before bind. Maybe it should only be done if nobody uses it.
From
man systemd.socket
:When you
systemctl stop foobar.socket
it then unlinks the socket from the file system, so it similarly should besystemfd
's responsibility to delete the socket during shutdown so the service can be started again.