strongSwan: /var/run/charon.vici 文件不存在问题

strongSwan: /var/run/charon.vici file does not exist issue

我在 VirtualBox 中有一个 Ubuntu Server 16.04 VM,使用以下命令在其上下载并安装了 strongSwan:

sudo apt-get install gcc make libgmp3-dev build-essential

wget http://download.strongswan.org/strongswan-5.6.0.tar.bz2
tar xjvf strongswan-5.6.0.tar.bz2
cd strongswan-5.6.0

./configure --prefix=/usr --sysconfdir=/etc
sudo make
sudo make install

sudo make之后说明将安装vici插件:

strongSwan will be built with the following plugins
-----------------------------------------------------
libstrongswan: aes des rc2 sha2 sha1 md5 random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pkcs8 pkcs12 pgp dnskey sshkey pem fips-prf gmp curve25519 xcbc cmac hmac
libcharon:     attr kernel-netlink resolve socket-default stroke vici updown xauth-generic
libtnccs:     
libtpmtss:

但是在构建和安装后 swanctl --stats 输出:

connecting to 'unix:///var/run/charon.vici' failed: No such file or directory
Error: connecting to 'default' URI failed: No such file or directory
strongSwan 5.6.0 swanctl

一切都像 strongSwan Installation Documentation 一样按部就班地完成。它不起作用的可能原因是什么?

问题的解决方案是启动 charon 守护进程并启用 strongswan 服务(这样重启后它会自动启动)。对于我的安装,我需要使用这些命令:

sudo /usr/libexec/ipsec/charon &
sudo systemctl enable strongswan.service

此外,我将此选项添加到配置中,因为我将 Ubuntu Server 16.04 与 systemd 一起使用:

sudo ./configure --prefix=/usr --sysconfdir=/etc <strong>--with-systemdsystemunitdir=/lib/systemd/system</strong>