fix: fake systemctl for pured.service + pre-install service file
purevpn-cli checks `systemctl is-active pured.service` to determine if components are installed. Without systemd this always returns inactive, triggering endless sudo/reinstall loop and ETXTBSY when trying to overwrite the running daemon binary. Fake systemctl returns "active" when pured is listening on :9485, "inactive" otherwise. Also handles start/stop/disable/daemon-reload as no-ops. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
15
vpn-node/systemctl.sh
Normal file
15
vpn-node/systemctl.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Fake systemctl for containers — handles pured.service lifecycle without systemd.
|
||||
# All other commands are no-ops so purevpn-cli installer steps don't break.
|
||||
case "$*" in
|
||||
*"is-active pured"*)
|
||||
nc -z 127.0.0.1 9485 2>/dev/null && echo "active" && exit 0
|
||||
echo "inactive"; exit 1 ;;
|
||||
*"start pured"*)
|
||||
NODE_ENV=production /opt/purevpn-cli/pured-linux-x64 --start &
|
||||
sleep 2; exit 0 ;;
|
||||
*"stop pured"*|*"disable pured"*)
|
||||
pkill -f "pured-linux-x64" 2>/dev/null || true; exit 0 ;;
|
||||
*)
|
||||
exit 0 ;;
|
||||
esac
|
||||
Reference in New Issue
Block a user