--- /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 +#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 ||