distribution/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch
2022-02-05 09:23:32 -05:00

43 lines
1.1 KiB
Diff

From: William Manley <will@williammanley.net>
Date: Thu, 9 Aug 2018 18:26:44 +0100
Subject: [PATCH] systemd support: Notify systemd on successful startup
This allows systemd to detect the case where we've failed to startup
due to a failure to parse our config files.
Origin: upstream, https://sourceforge.net/p/lirc/git/ci/b78df9b2950cf4
Applied-Upstream: 0.11.0
---
daemons/lircd.cpp | 5 +++++
systemd/lircd.service | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp
index ad8dde9..f559b62 100644
--- a/daemons/lircd.cpp
+++ b/daemons/lircd.cpp
@@ -2469,6 +2469,11 @@ int main(int argc, char** argv)
if (!nodaemon)
daemonize();
+#ifdef HAVE_SYSTEMD
+ /* Tell systemd that we started up correctly */
+ sd_notify(0, "READY=1");
+#endif
+
loop();
/* never reached */
diff --git a/systemd/lircd.service b/systemd/lircd.service
index 7f75805..6af049b 100644
--- a/systemd/lircd.service
+++ b/systemd/lircd.service
@@ -6,7 +6,7 @@ Wants=lircd-setup.service
After=network.target lircd-setup.service
[Service]
-Type=simple
+Type=notify
ExecStart=/usr/sbin/lircd --nodaemon
; User=lirc
; Group=lirc