[PATCH] Add support for systemd socket activation
Emanuele Giaquinta
emanuele.giaquinta at gmail.com
Sun May 9 08:12:51 CEST 2021
On Fri, Nov 30, 2018 at 06:45:10PM -0500, hot12shots wrote:
> An existing solution to on-demand activation is the urxvtc wrapper
> script provided by the urxvtc manpage. For systems that run urxvtd as
> a systemd service, this script could be adapted as follows:
>
> #!/bin/sh
> urxvtc "$@"
> if [ $? -eq 2 ]; then
> systemctl --user start urxvtd.service
> urxvtc "$@"
> fi
>
> I feel the socket activation approach is preferable for the sake of
> consistency on these systems. Other similar on-demand services are
> likely to be using socket activation, so the user will expect urxvtd
> to be configured this way. (As an admin I'd find it easier to remember
> that services A, B, and C are socket activated, than that A and C are
> socket-activated whereas B has a custom wrapper script.) In addition,
> since systemctl exits as soon as the service daemon is launched, it
> seems possible (if unlikely) to have a race condition where the second
> urxvtc invocation occurs before urxvtd has created its socket, leading
> to failure.
This is now supported in urxvt cvs [1] and will be included in the
next release. I implemented it differently so as to avoid a dependency
on libsystemd, for the benefit of nosh [2]. Let us know if it works
for you and thanks for your contribution.
[1] https://github.com/exg/rxvt-unicode/commit/c45d460a05917f78160d8530ec8b6d42a60ed7e5
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=234276
Emanuele
More information about the rxvt-unicode
mailing list