diff --git a/strongswan.spec b/strongswan.spec index 2681f300d74..a696334e099 100644 --- a/strongswan.spec +++ b/strongswan.spec @@ -37,6 +37,7 @@ Linux Kernel. %prep %setup cp -f systemd-conf/strongswan-starter.service.in.centos init/systemd-starter/strongswan-starter.service.in +cp -f systemd-conf/strongswan.service.in.centos init/systemd/strongswan.service.in %build %configure \ diff --git a/systemd-conf/strongswan.service.in.centos b/systemd-conf/strongswan.service.in.centos new file mode 100755 index 00000000000..d65e9882abd --- /dev/null +++ b/systemd-conf/strongswan.service.in.centos @@ -0,0 +1,14 @@ +[Unit] +Description=strongSwan IPsec IKEv1/IKEv2 daemon using ipsec.conf +After=syslog.target network-online.target + +[Service] +ExecStartPre=/bin/cp -f /etc/pki/tls/openssl.cnf.orig /etc/pki/tls/openssl.cnf +ExecStart=@SBINDIR@/@IPSEC_SCRIPT@ start --nofork +ExecStartPost=/bin/sleep 2 +ExecStartPost=/bin/bash -c 'if lscpu | grep Flags | grep sha1 | grep sha2 | grep -q aes 2>/dev/null; then /bin/cp -f /etc/pki/tls/openssl.cnf.mlnx /etc/pki/tls/openssl.cnf; fi' +StandardOutput=syslog +Restart=on-abnormal + +[Install] +WantedBy=multi-user.target