Skip to content

Commit ece8022

Browse files
committed
fix: disable strongswan autostart in postinst
1. Add `systemctl disable strongswan` to dcc-network-plugin.postinst, alongside the existing ipsec/xl2tpd/openvpn disables. 2. strongSwan 6.x ships only a native systemd unit (strongswan.service), no LSB init script, so update-rc.d cannot handle it; use systemctl disable instead. 3. The `ipsec` entry maps to /etc/init.d/ipsec from strongswan-starter, the legacy SysV stack; the `strongswan` metapackage instead installs the systemd stack (charon-systemd + strongswan-swanctl), so that entry is a no-op here. strongswan comes in via the network-manager-strongswan dependency, and its strongswan.service declares WantedBy=multi-user.target, so it autostarts once installed. Log: unreviewed strongswan.service no longer autostarts (security baseline) Influence: 1. Fresh install: `systemctl list-unit-files | grep strongswan` shows disabled; strongswan.service must not autostart at boot. 2. Upgrade existing install: postinst re-run emits no error and strongswan.service ends up disabled. 3. IPsec VPN via NetworkManager still works (backend started on demand). PMS: BUG-379501 fix: postinst 中禁用 strongswan 自启 1. 在 dcc-network-plugin.postinst 中新增 `systemctl disable strongswan`, 与已有的 ipsec/xl2tpd/openvpn 禁用逻辑并列。 2. strongSwan 6.x 仅提供原生 systemd 单元(strongswan.service),无 LSB init 脚本,update-rc.d 无法处理,需改用 systemctl disable。 3. 上面的 `ipsec` 对应 strongswan-starter 提供的 /etc/init.d/ipsec,属传统 SysV 栈;而 `strongswan` 元包实际安装的是 systemd 栈(charon-systemd + strongswan-swanctl),故该条在此为空操作。strongswan 经 network-manager-strongswan 依赖引入,其 strongswan.service 声明 WantedBy=multi-user.target,安装即开机自启。 Log: 系统自启服务不再包含未经评审的 strongswan.service(安全基线) Influence: 1. 全新安装:`systemctl list-unit-files | grep strongswan` 应为 disabled, 开机不再自启 strongswan.service。 2. 升级安装:重跑 postinst 无报错,strongswan.service 被禁用。 3. 通过 NetworkManager 使用 IPsec VPN 仍正常(后端按需启动)。 PMS: BUG-379501
1 parent f644566 commit ece8022

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎debian/dcc-network-plugin.postinst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ if [ ! -e /var/cache/deepin/mark-setup-network-services ];then
66
update-rc.d ipsec disable || true
77
update-rc.d xl2tpd disable || true
88
update-rc.d openvpn disable || true
9+
systemctl disable strongswan || true
910
mkdir -p /var/cache/deepin
1011
touch /var/cache/deepin/mark-setup-network-services
1112
fi

0 commit comments

Comments
 (0)