aboutsummaryrefslogtreecommitdiff
path: root/windscribe-helper.initd
diff options
context:
space:
mode:
authorishaan <>2026-07-01 10:11:39 +0530
committerishaan <>2026-07-01 10:11:39 +0530
commit254d1d61386ce516bf02589bc96a64d9ed2bdf78 (patch)
tree9665ec242043da4ddb175f27d9755ae56fa58428 /windscribe-helper.initd
init
Diffstat (limited to 'windscribe-helper.initd')
-rwxr-xr-xwindscribe-helper.initd31
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
+}