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

Martin Willi martin at strongswan.org
Tue Mar 29 09:43:16 CEST 2011


Hi Miklos,

> 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 for the patch. Some comments:

> +AC_ARG_WITH([systemdsystemunitdir],
> +           AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),

We have some helper macros to simplify WITH argument handling,
ARG_WITH_SET() would work fine here.

> +           [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])

I think this statement requires pkg-config installed, but pkg-config is
not a strongSwan dependency (only to build a ./configure for a
distribution, not to run it).

> +++ b/scripts/strongswan.service

Scripts is probably not the best place for init system stuff, it mainly
contains developer tools not installed on a end user system. I'd prefer
a new subdirectory "init", with systemd being one of the variants in
there.

> +[Service]
> +ExecStart=/usr/sbin/ipsec start --nofork

sbindir by default points to /usr/local/sbin, we should replace this
value by sbindir.

I've attached a patch addressing these issues. I don't have a systemd
enabled installation, please let me know if that works as expected.

Regards
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Install-systemd-service-file-if-systemd-is-available.patch
Type: text/x-patch
Size: 3023 bytes
Desc: not available
URL: <http://lists.strongswan.org/pipermail/dev/attachments/20110329/1045b279/attachment.bin>


More information about the Dev mailing list