Skip to content

Use pidfile and remove stale socket files

Christoph Haag requested to merge haagch/monado:pidfile into master

Like !558 (closed) this makes it more convenient to start up monado-service after it crashed or was killed without a clean shutdown. We can still add a code path with abstract namespace sockets later if we want (android?).

When built with libbsd support:

  • a pidfile in the XDG_RUNTIME_DIR (falls back to /tmp if not set) is created.
  • monado can immediately detect other running instances on startup and exit.
  • if monado-service encounters an ipc socket file, it attempts to delete it and retries binding the socket. If that still fails (permissions?), it exits with an error message as before.

When built without libbsd:

  • the previous behavior is used: when monado-service encounters an ipc socket file, it exits with an error message.

Additionally, XDG_RUNTIME_DIR is now used for the ipc socket file (again, fallback to /tmp if not set).

With systemd socket activation listen to %t/monado_comp_ipc which expands to XDG_RUNTIME_DIR. Unfortunately it will be hard to deal with the client falling back to /tmp with systemd socket activation.

Merge request reports