From 023eb3465d87a83eadcc32c1e0f8f99092039463 Mon Sep 17 00:00:00 2001 From: nynauy <126393097+nynauy@users.noreply.github.com> Date: Tue, 17 Sep 2024 07:03:19 +0800 Subject: [PATCH] Correct and simplify systemd service files Remove unnecessary wrappers and change to start services directly. Also remove misused "EnvironmentFile" and unrecommended "KillMode=process". --- systemd/softether-vpnbridge.service | 7 ++----- systemd/softether-vpnclient.service | 7 ++----- systemd/softether-vpnserver.service | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/systemd/softether-vpnbridge.service b/systemd/softether-vpnbridge.service index b4d3cc8c..6e415e7d 100644 --- a/systemd/softether-vpnbridge.service +++ b/systemd/softether-vpnbridge.service @@ -4,11 +4,8 @@ After=network.target auditd.service ConditionPathExists=!@DIR@/softether/vpnbridge/do_not_run [Service] -Type=forking -EnvironmentFile=-@DIR@/softether/vpnbridge -ExecStart=@DIR@/softether/vpnbridge/vpnbridge start -ExecStop=@DIR@/softether/vpnbridge/vpnbridge stop -KillMode=process +Type=exec +ExecStart=@DIR@/softether/vpnbridge/vpnbridge execsvc Restart=on-failure # Hardening diff --git a/systemd/softether-vpnclient.service b/systemd/softether-vpnclient.service index 6bac5267..e66d8abd 100644 --- a/systemd/softether-vpnclient.service +++ b/systemd/softether-vpnclient.service @@ -4,11 +4,8 @@ After=network.target auditd.service ConditionPathExists=!@DIR@/softether/vpnclient/do_not_run [Service] -Type=forking -EnvironmentFile=-@DIR@/softether/vpnclient -ExecStart=@DIR@/softether/vpnclient/vpnclient start -ExecStop=@DIR@/softether/vpnclient/vpnclient stop -KillMode=process +Type=exec +ExecStart=@DIR@/softether/vpnclient/vpnclient execsvc Restart=on-failure # Hardening diff --git a/systemd/softether-vpnserver.service b/systemd/softether-vpnserver.service index 1ba16246..2a02a8ac 100644 --- a/systemd/softether-vpnserver.service +++ b/systemd/softether-vpnserver.service @@ -4,12 +4,9 @@ After=network.target auditd.service ConditionPathExists=!@DIR@/softether/vpnserver/do_not_run [Service] -Type=forking +Type=exec TasksMax=infinity -EnvironmentFile=-@DIR@/softether/vpnserver -ExecStart=@DIR@/softether/vpnserver/vpnserver start -ExecStop=@DIR@/softether/vpnserver/vpnserver stop -KillMode=process +ExecStart=@DIR@/softether/vpnserver/vpnserver execsvc Restart=on-failure # Hardening