[strongSwan-dev] [PATCH] Install systemd service file if systemd is available

Miklos Vajna vmiklos at frugalware.org
Mon Mar 28 22:09:02 CEST 2011


Hi,

I'm attaching a patch adding strongswan.service for systemd[1]. I'm
submitting it as a patch, as one of systemd's great idea is to let
upstream ship service files, so the "every distro packager writes his
own rc script" issue won't happen again. :)

Thanks,

Miklos

[1] http://www.freedesktop.org/wiki/Software/systemd
-------------- next part --------------
From e2c8099ee7fc4167f057bebd7b1aec0052b7e03c Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Mon, 28 Mar 2011 20:04:00 +0200
Subject: [PATCH] Install systemd service file if systemd is available

---
 Makefile.am                |    5 +++++
 configure.in               |    8 ++++++++
 scripts/strongswan.service |   10 ++++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 scripts/strongswan.service

diff --git a/Makefile.am b/Makefile.am
index cba5048..437a7cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,6 +11,11 @@ CLEANFILES = Doxyfile
 BUILT_SOURCES = Android.mk
 MAINTAINERCLEANFILES = Android.mk
 
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+	scripts/strongswan.service
+endif
+
 Android.mk :	Android.mk.in configure.in
 		sed \
 		-e "s:\@PACKAGE_VERSION\@:$(PACKAGE_VERSION):" \
diff --git a/configure.in b/configure.in
index 6dcf65c..805be43 100644
--- a/configure.in
+++ b/configure.in
@@ -545,6 +545,14 @@ if test x$dumm = xtrue; then
 	fi
 fi
 
+AC_ARG_WITH([systemdsystemunitdir],
+	    AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+	    [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+	AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
+
 if test x$fast = xtrue; then
 	AC_HAVE_LIBRARY([neo_cgi],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_cgi not found!])])
 	AC_HAVE_LIBRARY([neo_utl],[LIBS="$LIBS"],[AC_MSG_ERROR([ClearSilver library neo_utl not found!])])
diff --git a/scripts/strongswan.service b/scripts/strongswan.service
new file mode 100644
index 0000000..7624ad8
--- /dev/null
+++ b/scripts/strongswan.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=StrongSwan IPsec
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/ipsec start --nofork
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
-- 
1.7.4.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20110328/35d8c228/attachment.pgp>


More information about the Dev mailing list