Skip to content

Instantly share code, notes, and snippets.

@charles-l
Last active May 13, 2026 16:54
Show Gist options
  • Select an option

  • Save charles-l/a9d974ccafe4d9000ae5cb2a522617bc to your computer and use it in GitHub Desktop.

Select an option

Save charles-l/a9d974ccafe4d9000ae5cb2a522617bc to your computer and use it in GitHub Desktop.
tailscaled sysvinit script for devuan
#!/bin/sh
### BEGIN INIT INFO
# Provides: tailscale
# Required-Start: $local_fs $all $network
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Tailscale daemon
# Description: Runs the tailscale daemon.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
PIDFILE=/var/run/tailscale.pid
LOGFILE=/var/log/tailscale.log
TAILSCALED=/usr/sbin/tailscaled
fail_unless_root() {
if [ "$(id -u)" != '0' ]; then
log_failure_msg "must be run as root"
exit 1
fi
}
case "$1" in
start)
fail_unless_root
$TAILSCALED --cleanup
start-stop-daemon --start --background --no-close \
--exec $TAILSCALED \
--pidfile "$PIDFILE" \
--make-pidfile \
-- \
--state=/var/lib/tailscale/tailscaled.state \
--socket=/run/tailscale/tailscaled.sock >> $LOGFILE 2>&1
status=$?
log_end_msg $status
;;
stop)
fail_unless_root
start-stop-daemon --stop --pidfile "$PIDFILE" \
--remove-pidfile --retry 10
status=$?
log_end_msg $status
;;
status)
status_of_proc -p "$PIDFILE" "$TAILSCALED" "tailscaled"
;;
*)
echo "Usage: $0 {start|stop|status}"
exit 1 ;;
esac
@bittin
Copy link
Copy Markdown

bittin commented May 13, 2026

I'm on MX Linux, same problem when running without the (optional) systemd

heh also using this on MXLinux now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment