init: Provide a service file for charon-systemd using swanctl
authorMartin Willi <martin@revosec.ch>
Thu, 11 Sep 2014 14:23:53 +0000 (16:23 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 22 Sep 2014 12:19:38 +0000 (14:19 +0200)
configure.ac
init/Makefile.am
init/systemd-swanctl/.gitignore [new file with mode: 0644]
init/systemd-swanctl/Makefile.am [new file with mode: 0644]
init/systemd-swanctl/strongswan-swanctl.service.in [new file with mode: 0644]

index 43556c5..3961270 100644 (file)
@@ -1566,6 +1566,7 @@ AC_CONFIG_FILES([
        man/Makefile
        init/Makefile
        init/systemd/Makefile
+       init/systemd-swanctl/Makefile
        src/Makefile
        src/include/Makefile
        src/libstrongswan/Makefile
index 83faf9d..a72706c 100644 (file)
@@ -4,3 +4,9 @@ SUBDIRS =
 if USE_LEGACY_SYSTEMD
   SUBDIRS += systemd
 endif
+
+if USE_SYSTEMD
+if USE_SWANCTL
+  SUBDIRS += systemd-swanctl
+endif
+endif
diff --git a/init/systemd-swanctl/.gitignore b/init/systemd-swanctl/.gitignore
new file mode 100644 (file)
index 0000000..b973780
--- /dev/null
@@ -0,0 +1 @@
+strongswan-swanctl.service
diff --git a/init/systemd-swanctl/Makefile.am b/init/systemd-swanctl/Makefile.am
new file mode 100644 (file)
index 0000000..eee30ac
--- /dev/null
@@ -0,0 +1,11 @@
+
+EXTRA_DIST = strongswan-swanctl.service.in
+CLEANFILES = strongswan-swanctl.service
+
+systemdsystemunit_DATA = strongswan-swanctl.service
+
+strongswan-swanctl.service : strongswan-swanctl.service.in
+       $(AM_V_GEN) \
+       sed \
+       -e "s:@SBINDIR@:$(sbindir):" \
+       $(srcdir)/$@.in > $@
diff --git a/init/systemd-swanctl/strongswan-swanctl.service.in b/init/systemd-swanctl/strongswan-swanctl.service.in
new file mode 100644 (file)
index 0000000..818d352
--- /dev/null
@@ -0,0 +1,9 @@
+[Unit]
+Description=strongSwan IPsec IKEv1/IKEv2 daemon using swanctl
+After=network.target
+
+[Service]
+Type=notify
+ExecStart=@SBINDIR@/charon-systemd
+ExecStartPost=@SBINDIR@/swanctl --load-all --noprompt
+ExecReload=@SBINDIR@/swanctl --reload