SteamOS icon indicating copy to clipboard operation
SteamOS copied to clipboard

Installing software and systemd services that survive updates

Open vincentchov opened this issue 3 months ago • 6 comments

Your system information

  • Steam client version: 1759461205
  • SteamOS version: 3.7.13
  • Opted into Steam client beta?: No
  • Opted into SteamOS beta?: No
  • Have you checked for updates in Settings > System?: Yes

Please describe your issue in as much detail as possible:

Hi, I'm looking to install software like the Netbird and Tailscale VPNs, which won't work when installed via Flatpak due to the need for lower-level access. Where should I be able place the standalone binaries and the systemd services?

According to the command mount | grep nvme | grep rw, the /var mount point is read-write. Because the /var/lib/overlays/etc/upper/ directory points to /etc/systemd/system, can I place a systemd service in /etc/systemd/system and expect it to survive updates?

Because the /opt mount point appears to be read-write, I think I can probably download the standalone binaries to there.

Are there any other mount points that I can expect to work, ie, under the /etc directory, even though they aren't returned by the mount | grep nvme | grep rw command?

The Tailscale installation script seems to suggest that the following can also be used, but I'm not sure if that's correct:

  • /etc/default/
  • /etc/profile.d
  • /etc/atomic-update.conf.d/

Thanks a lot for the help!

vincentchov avatar Oct 03 '25 19:10 vincentchov

Any changes to /etc can be saved if you add a file in /etc/atomupdate-conf.d/ similar to the example-additional-keep-list.conf file that is there already. Copy that one and add what you want it to preserve. Also look at /usr/lib/rauc/atomic-update-keep.conf to see what is preserved in /etc by default.

Where to put your files is a different matter. /var gets formatted and synced from the old one on each update with some exclusions. /opt is on the same partition as /home so should be fine though.

jpwhiting avatar Oct 03 '25 19:10 jpwhiting

@vincentchov As another possibility, maybe you could install in /home/deck (or /home/opt, or /home directly), and then files in /etc to enable the service (as described in the previous comment). The data in that partition survives upgrades.

manuelafm avatar Oct 14 '25 09:10 manuelafm

Thanks! Is there a way I can test that the changes persist, even though I'm now running the latest general release of Steam OS?

During some live troubleshooting with a Netbird employee, we got it installed and I confirmed it still worked when I then updated Steam OS.

Now I want to uninstall and reinstall Netbird so I can test changes that we'll propose to their installation script.

This is our temporary script that I'll use to confirm I can reproduce the steps we manually took:

VERSION="0.59.2"

# cleanup the temporary directory
if test -d /opt/netbird/tmp ; then
	rm -r /opt/netbird/tmp
fi

mkdir -p /opt/netbird/bin /opt/netbird/tmp
cd /opt/netbird/tmp

# download and unpack release
wget "https://github.com/netbirdio/netbird/releases/download/v${VERSION}/netbird_${VERSION}_linux_amd64.tar.gz"
tar zxf "netbird_$VERSION_linux_amd64.tar.gz"

# move the binary to the right place
mv netbird /opt/netbird/bin/netbird
chmod +x /opt/netbird/bin/netbird

# create config files
cat <<EOF > /etc/profile.d/netbird.sh
append_path /opt/netbird/bin
EOF
cat <<EOF > /etc/atomic-update.conf.d/netbird.conf
/etc/profile.d/netbird.sh
EOF

/opt/netbird/bin/netbird service install
/opt/netbird/bin/netbird service start

Thanks again!

vincentchov avatar Oct 23 '25 14:10 vincentchov

Testing if changes survive an OS update can be done pretty simply by making your changes then switching branches of the OS and performing an update.

i.e. if you are running main, switch from main to bc or beta or stable, then update to it.

This can even be scripted by using

sudo steamos-select-branch bc
sudo steamos-atomupd-client

jpwhiting avatar Oct 23 '25 15:10 jpwhiting

Okay, do those commands/steps apply even though I'm not using a developer version of Steam OS? I think this means I'm running "stable", or whichever is the default variant of Steam OS that end-users use.

If I were to switch to the beta "branch" , would this be equivalent to selecting the Beta "channel" in the GUI? For example, changing the option in Settings > System > System Update Channel (under the "Beta Participation" subheading) from "Stable" to "Beta" and vice-versa. Under "System Update Channel", I only see "Stable", "Beta", and "Preview" as options, so no "bc" or "main".

vincentchov avatar Oct 23 '25 16:10 vincentchov

Yeah, you can switch back and forth safely between any of the versions. You can switch back and forth between beta and stable in the same way.

jpwhiting avatar Oct 23 '25 16:10 jpwhiting