use provided files, override

This commit is contained in:
Duncan Gibson
2023-07-19 19:10:37 -04:00
parent c2fe75c176
commit a31db4859e
4 changed files with 19 additions and 32 deletions

2
override.conf Normal file
View File

@@ -0,0 +1,2 @@
[Service]
ExtensionDirectories=/var/lib/extensions/tailscale

View File

@@ -13,10 +13,9 @@ connect through the standard SSH server instead. Suggestions for how to fix this
are welcomed.
1. Clone this repo to your Deck.
2. Copy the `tailscaled.service` file to `/etc/systemd/system/`.
3. Run `sudo bash tailscale.sh` to install Tailscale (or update the existing
2. Run `sudo bash tailscale.sh` to install Tailscale (or update the existing
installation).
4. Run `sudo tailscale up --qr --operator=deck --ssh` to have Tailscale generate
3. Run `sudo tailscale up --qr --operator=deck --ssh` to have Tailscale generate
a login QR code. Scan the code with your phone and authenticate with
Tailscale to bring your Deck onto your network.

View File

@@ -53,10 +53,23 @@ mkdir -p /var/lib/extensions
rm -rf /var/lib/extensions/tailscale
cp -rf tailscale /var/lib/extensions/
# copy the systemd files into place
cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system
# copy in the defaults file if it doesn't already exist
if ! test -f /etc/default/tailscaled; then
cp -rf $tar_dir/systemd/tailscaled.defaults /etc/default/tailscaled
fi
# return to our original directory (silently) and clean up
popd > /dev/null
rm -rf "${dir}"
# copy in our overrides file if it doesn't already exist
if ! test -f /etc/systemd/system/tailscaled.service.d/override.conf; then
cp -rf override.conf /etc/systemd/system/tailscaled.service.d/override.conf
fi
echo "done."
echo -n "Starting services..."
@@ -71,12 +84,10 @@ systemd-sysext refresh > /dev/null 2>&1
systemctl daemon-reload > /dev/null
if systemctl is-enabled --quiet tailscaled && systemctl is-active --quiet tailscaled; then
echo "tailscaled is already enabled and active"
echo "tailscaled is already enabled and active; restarting it..."
systemctl restart tailscaled
else
systemctl enable tailscaled --now
fi
echo "done."
echo "If updating, reboot or run the following to finish the process: sudo systemctl restart tailscaled"

View File

@@ -1,25 +0,0 @@
[Unit]
Description=Tailscale node agent
Documentation=https://tailscale.com/kb/
Wants=network-pre.target
After=network-pre.target NetworkManager.service systemd-resolved.service
[Service]
ExtensionDirectories=/var/lib/extensions/tailscale
ExecStartPre=/usr/sbin/tailscaled --cleanup
ExecStart=/usr/sbin/tailscaled --state=/var/lib/tailscale/tailscaled.state --socket=/run/tailscale/tailscaled.sock
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