#!/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 }