diff --git a/doc/aiccu.service b/doc/aiccu.service new file mode 100644 index 0000000..17cf756 --- /dev/null +++ b/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 diff --git a/unix-console/Makefile b/unix-console/Makefile index ae9fe3b..91786e1 100755 --- a/unix-console/Makefile +++ b/unix-console/Makefile @@ -47,7 +47,7 @@ ifeq ($(shell uname | grep -c "Linux"),1) CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\"" SRCS += ../common/aiccu_linux.c OBJS += ../common/aiccu_linux.o -LIBS += -lpthread -lresolv +LIBS += -lpthread -lresolv -lsystemd-daemon endif # FreeBSD diff --git a/unix-console/main.c b/unix-console/main.c index b36b248..d5add4a 100755 --- a/unix-console/main.c +++ b/unix-console/main.c @@ -12,6 +12,7 @@ #include "../common/aiccu.h" #include "../common/tun.h" +#include #ifndef _WIN32 /* Enable/Disable heartbeating */ @@ -478,6 +479,8 @@ int main(int argc, char *argv[]) aiccu_exec("%s", g_aiccu->setupscript); } + /* Tell systemd we are operational. */ + sd_notify(0, "READY=1"); /* We need to stay running when doing Heartbeat or AYIYA */ if ( strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 ||