diff options
Diffstat (limited to 'windscribe-helper.initd')
| -rwxr-xr-x | windscribe-helper.initd | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/windscribe-helper.initd b/windscribe-helper.initd new file mode 100755 index 0000000..a2fecdb --- /dev/null +++ b/windscribe-helper.initd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +# Windscribe helper daemon + +description="Windscribe VPN helper daemon" +command="/opt/windscribe/helper" +command_background="yes" +pidfile="/run/windscribe/helper.pid" + +# Ensure /run/windscribe exists before starting +start_stop_daemon_args="--make-pidfile" + +depend() { + # Upstream systemd unit: Before=network-pre.target + # OpenRC equivalent: start before network mounts so helper can manage routes/firewall + before netmount +} + +start_pre() { + # Ensure runtime directories exist with correct perms + checkpath -d -m 0755 -o root:windscribe /run/windscribe + checkpath -d -m 0755 -o root:windscribe /var/log/windscribe + checkpath -d -m 0755 -o root:windscribe /var/tmp/windscribe + checkpath -d -m 0755 -o root:windscribe /var/lib/windscribe +} + +stop_post() { + # Clean up cgroup routing tables if helper created them + if [ -x /opt/windscribe/scripts/cgroups-down ]; then + /opt/windscribe/scripts/cgroups-down >/dev/null 2>&1 || true + fi +} |