File: 0005-systemd-support-Notify-systemd-on-successful-startup.patch

package info (click to toggle)
lirc 0.10.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 8,364 kB
  • sloc: ansic: 26,717; cpp: 9,066; sh: 5,521; python: 4,362; makefile: 1,034; xml: 63
file content (43 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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