The officially official Devuan Forum!

You are not logged in.

#1 2024-10-27 18:38:53

recklessswing
Member
From: Türkiye
Registered: 2020-12-18
Posts: 103  

Is this Tailscale initscript good?

In debian tailscale works without this. But on devuan it didn't. So I searched for an initscript file. I found this out of github. How is it:
#!/bin/sh
# Generated by sysd2v v0.3  --  http://www.trek.eu.org/devel/sysd2v
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:       tailscaled
# Required-Start: $remote_fs
# Required-Stop:  $remote_fs
# Should-Start:   $local_fs NetworkManager systemd-resolved
# Should-Stop:    $local_fs NetworkManager systemd-resolved
# Default-Start:  2 3 4 5
# Default-Stop:   0 1 6
# Description:    Tailscale node agent
### END INIT INFO
set -a
RUNTIME_DIRECTORY=/run/tailscale
STATE_DIRECTORY=/var/lib/tailscale
CACHE_DIRECTORY=/var/cache/tailscale
. /etc/default/tailscaled
set +a

DAEMON=/usr/sbin/tailscaled
DAEMON_ARGS="--state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port=${PORT} $FLAGS"
PIDFILE=/var/run/tailscaled-sysd2v.pid
START_ARGS="--background --make-pidfile --notify-await"

do_start_cmd_override ()
{
  install -d -m 0755 /run/tailscale || return 2
  install -d -m 0700 /var/lib/tailscale || return 2
  install -d -m 0750 /var/cache/tailscale || return 2
  /usr/sbin/tailscaled --cleanup || return 2
  do_start_cmd || return $?
}

do_stop_cmd_override ()
{
  do_stop_cmd || return $?
  /usr/sbin/tailscaled --cleanup || return 2
}

Offline

#2 2024-10-28 12:40:12

Andre4freedom
Member
Registered: 2017-11-15
Posts: 174  

Re: Is this Tailscale initscript good?

There exists somewhere a script to convert systemd unit files to initSysV scripts. But have you considered to create a fresh initscript from a template?
You could work with a fresh template file.

Hints:
https://github.com/fhd/init-script-temp … r/template
https://www.linuxnix.com/write-sysvinit-scripts/

Offline

#3 2024-10-28 13:46:03

stargate-sg1-cheyenne-mtn
Member
Registered: 2023-11-27
Posts: 208  

Re: Is this Tailscale initscript good?

enjoyed this informative tailscale webpage(even if it is somewhat off-topic):

The Sisyphean Task Of DNS Client Config on Linux
https://tailscale.com/blog/sisyphean-dns-client-linux


Be Excellent to each other and Party On!
https://www.youtube.com/watch?v=rph_1DODXDU
https://en.wikipedia.org/wiki/Bill_%26_Ted%27s_Excellent_Adventure
Do unto others as you would have them do instantaneously back to you!

Offline

Board footer