summaryrefslogtreecommitdiff
blob: e8616d04b3fcb22558e40d798534b6fd869b152e (plain)
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
44
45
46
47
48
49
50
51
52
--- /dev/null
+++ aiccu-2007.01.15/doc/aiccu.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Automatic IPv6 Connectivity Client Utility
+After=time-sync.target network.target
+ConditionPathExists=/etc/aiccu.conf
+
+
+[Service]
+Type=notify
+ExecStart=/usr/sbin/aiccu start
+ExecStop=/usr/sbin/aiccu stop
+
+[Install]
+WantedBy=multi-user.target
--- aiccu-2007.01.15/unix-console/Makefile
+++ aiccu-2007.01.15/unix-console/Makefile
@@ -48,6 +48,10 @@ ifeq ($(shell uname | grep -c "Linux"),1)
 SRCS	+= ../common/aiccu_linux.c
 OBJS	+= ../common/aiccu_linux.o
 LIBS	+= -lpthread -lresolv
+ifeq (1,$(HAVE_SYSTEMD))
+LIBS	+= $(shell pkg-config --libs libsystemd 2>/dev/null || pkg-config --libs libsystemd-daemon)
+CFLAGS += -DHAVE_SYSTEMD
+endif
 endif
 
 # FreeBSD
--- aiccu-2007.01.15/unix-console/main.c
+++ aiccu-2007.01.15/unix-console/main.c
@@ -12,6 +12,9 @@
 
 #include "../common/aiccu.h"
 #include "../common/tun.h"
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
 
 #ifndef _WIN32
 /* Enable/Disable heartbeating */
@@ -478,6 +481,10 @@ int main(int argc, char *argv[])
 			aiccu_exec("%s", g_aiccu->setupscript);
 		}
 
+#ifdef HAVE_SYSTEMD
+		/* Tell systemd we are operational. */
+		sd_notify(0, "READY=1");
+#endif
 
 		/* We need to stay running when doing Heartbeat or AYIYA */
 		if (	strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 ||