From 13971e7371259c51b2658dffe33123017e57861d Mon Sep 17 00:00:00 2001 From: "Soc Virnyl S. Estela" Date: Tue, 19 Apr 2022 01:00:49 +0800 Subject: [PATCH] Update systemd service files - add ConditionEnvironment so that it only runs if WAYLAND_DISPLAY environmental variable exists. - replace wayland-instance@.target to the generic graphical-session.target. Not sure about this btw but I feel like wayland-instance@.target is not needed. - remove `Requires=%N.socket` in [Unit]. Documentations says "No implicit WantedBy= or RequiredBy= dependency from the socket to the service is added. This means that the service may be started without the socket, in which case it must be able to open sockets by itself. To prevent this, an explicit Requires= dependency may be added." - add `Also=%N.socket` in [Install]. - replace wayland-instance@.target to generic sockets.target in foot-server@.socket. --- foot-server@.service.in | 20 ++++++++++++-------- foot-server@.socket | 5 ++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/foot-server@.service.in b/foot-server@.service.in index 81c13bb4..a9b954c4 100644 --- a/foot-server@.service.in +++ b/foot-server@.service.in @@ -1,13 +1,17 @@ -[Service] -ExecStart=@bindir@/foot --server=0 -Environment=WAYLAND_DISPLAY=%i -NonBlocking=true -StandardInput=socket - [Unit] -Requires=%N.socket Description=Foot terminal server mode for WAYLAND_DISPLAY=%i Documentation=man:foot(1) +PartOf=graphical-session.target +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +ExecStart=@bindir@/foot --server=0 +Environment="WAYLAND_DISPLAY=%i" +NonBlocking=true +StandardInput=socket +Restart=on-failure [Install] -WantedBy=wayland-instance@.target +Also=%N.socket +WantedBy=graphical-session.target diff --git a/foot-server@.socket b/foot-server@.socket index 71db51cb..2a3cfa37 100644 --- a/foot-server@.socket +++ b/foot-server@.socket @@ -1,5 +1,8 @@ +[Unit] +Description=Foot server socket + [Socket] ListenStream=%t/foot-%i.sock [Install] -WantedBy=wayland-instance@.target +WantedBy=sockets.target