Coder Social home page Coder Social logo

Comments (5)

adyanth avatar adyanth commented on May 17, 2024

Hey @slhck the autoupdate is meant to check at the next reboot. (/tmp does not persist on reboots, ramfs/tmpfs)

If you want to upgrade in place, it can be done. Stop the service using /etc/init.d/tailscale stop, kill any running tailscaled processes, rm -f /tmp/tailscale* and then start the service back using /etc/init.d/tailscale start. Should download the new one.

Did you have any ideas on how it could be better achieved?

from openwrt-tailscale-enabler.

slhck avatar slhck commented on May 17, 2024

Thanks for the explanation.

I guess rebooting is not a common task — for me at least.

Do you know if it is possible to update in-place like the Ubuntu packages for Tailscale are doing it? Automatically reinstating the connection, that is.

I don't have an easy solution for the time being. Ideally the new binaries would be downloaded asynchronously and replaced after being extracted, then triggering a restart of the service.

from openwrt-tailscale-enabler.

adyanth avatar adyanth commented on May 17, 2024

A service restart should still reconnect you to the network. Maybe the init system can handle the upgrades using an upgrade command? Not sure, need to explore.

from openwrt-tailscale-enabler.

slhck avatar slhck commented on May 17, 2024

I looked into the Ubuntu packages and it seems that all that is done is reloading the service in the postinst file:

if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	deb-systemd-helper unmask 'tailscaled.service' >/dev/null || true
	if deb-systemd-helper --quiet was-enabled 'tailscaled.service'; then
		deb-systemd-helper enable 'tailscaled.service' >/dev/null || true
	else
		deb-systemd-helper update-state 'tailscaled.service' >/dev/null || true
	fi

	if [ -d /run/systemd/system ]; then
		systemctl --system daemon-reload >/dev/null || true
		deb-systemd-invoke start 'tailscaled.service' >/dev/null || true
	fi
fi

The systemd service itself has a cleanup action in addition to what you have in your package now; not sure if that is needed:

[Unit]
Description=Tailscale node agent
Documentation=https://tailscale.com/kb/
Wants=network-pre.target
After=network-pre.target NetworkManager.service systemd-resolved.service

[Service]
EnvironmentFile=/etc/default/tailscaled
ExecStartPre=/usr/sbin/tailscaled --cleanup
ExecStart=/usr/sbin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock --port $PORT $FLAGS
ExecStopPost=/usr/sbin/tailscaled --cleanup

Restart=on-failure

RuntimeDirectory=tailscale
RuntimeDirectoryMode=0755
StateDirectory=tailscale
StateDirectoryMode=0700
CacheDirectory=tailscale
CacheDirectoryMode=0750
Type=notify

[Install]
WantedBy=multi-user.target

But the tailscale client can't be restarted so easily, right? I wonder how that is done.

from openwrt-tailscale-enabler.

adyanth avatar adyanth commented on May 17, 2024

The postinst makes extensive use of systemd specific stuff which wont work in openwrt's init system. Translating this is the main task.

tailscale client is a run and die binary. Just deleting the /tmp/tailscale file causes the next download to use the latest binary available. The tailscaled is the only one that needs action since it runs as a daemon.

from openwrt-tailscale-enabler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.