1 |
xmw 13/05/24 07:09:06 |
2 |
|
3 |
Added: aiccu-2007.01.15-systemd.patch |
4 |
Log: |
5 |
Add systemd support (thanks Ćukasz Stelmach, bug 444692) |
6 |
|
7 |
(Portage version: 2.2.0_alpha175/cvs/Linux x86_64, signed Manifest commit with key 62EEF090) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-misc/aiccu/files/aiccu-2007.01.15-systemd.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/aiccu/files/aiccu-2007.01.15-systemd.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/aiccu/files/aiccu-2007.01.15-systemd.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: aiccu-2007.01.15-systemd.patch |
16 |
=================================================================== |
17 |
--- /dev/null |
18 |
+++ aiccu-2007.01.15/doc/aiccu.service |
19 |
@@ -0,0 +1,13 @@ |
20 |
+[Unit] |
21 |
+Description=Automatic IPv6 Connectivity Client Utility |
22 |
+After=time-sync.target network.target |
23 |
+ConditionPathExists=/etc/aiccu.conf |
24 |
+ |
25 |
+ |
26 |
+[Service] |
27 |
+Type=notify |
28 |
+ExecStart=/usr/sbin/aiccu start |
29 |
+ExecStop=/usr/sbin/aiccu stop |
30 |
+ |
31 |
+[Install] |
32 |
+WantedBy=multi-user.target |
33 |
--- aiccu-2007.01.15/unix-console/Makefile |
34 |
+++ aiccu-2007.01.15/unix-console/Makefile |
35 |
@@ -48,6 +48,10 @@ ifeq ($(shell uname | grep -c "Linux"),1) |
36 |
SRCS += ../common/aiccu_linux.c |
37 |
OBJS += ../common/aiccu_linux.o |
38 |
LIBS += -lpthread -lresolv |
39 |
+ifeq (1,HAVE_SYSTEMD) |
40 |
+LIBS += -lsystemd-daemon |
41 |
+CFLAGS += -DHAVE_SYSTEMD |
42 |
+endif |
43 |
endif |
44 |
|
45 |
# FreeBSD |
46 |
--- aiccu-2007.01.15/unix-console/main.c |
47 |
+++ aiccu-2007.01.15/unix-console/main.c |
48 |
@@ -12,6 +12,9 @@ |
49 |
|
50 |
#include "../common/aiccu.h" |
51 |
#include "../common/tun.h" |
52 |
+#ifdef HAVE_SYSTEMD |
53 |
+#include <systemd/sd-daemon.h> |
54 |
+#endif |
55 |
|
56 |
#ifndef _WIN32 |
57 |
/* Enable/Disable heartbeating */ |
58 |
@@ -478,6 +481,10 @@ int main(int argc, char *argv[]) |
59 |
aiccu_exec("%s", g_aiccu->setupscript); |
60 |
} |
61 |
|
62 |
+#ifdef HAVE_SYSTEMD |
63 |
+ /* Tell systemd we are operational. */ |
64 |
+ sd_notify(0, "READY=1"); |
65 |
+#endif |
66 |
|
67 |
/* We need to stay running when doing Heartbeat or AYIYA */ |
68 |
if ( strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 || |