Roon Server Early Access on DietPi X86

I use DietPi on x86 hosted on a NUC to run my Roon Server.

Earlier today, I was asked (by PM) about some details of the Roon Server on DietPi experience and it occurred to me that there was one aspect about which I didn’t know the answer.

Specifically, when running Roon Server on DietPi, what is the best way to change from the production release to the early access release and vice-versa? Is it even supported?

I imagine that the Roon Server install script (as used by dietpi-software) will only install the production version of Roon Server and, this being so, thus it should be done using the generic linux instructions at:

Which in turn references the linux install procedure at:

Looking at the easy install script linked to from the above site, there are comments saying that " - $PACKAGE_NAME’s data will be stored in /var/roon/$PACKAGE_NAME" and the script sets and exports a couple of environment variables that refer to this location.

However, on DietPi, I believe that the data is stored in /mnt/dietpi_userdata/roonserver.

Thus, it looks to me like the easy install script may not be compatible with a Dietpi Roon Server installation.

If this is the case, is there a recommended way of change to the early access build of Roon Server (and back to production) given an installation of Roon Server originally installed by the dietpi-software script?

Is it simply a case of uncompressing the contents of the full package and using them to overwrite the contents of /opt/roonserver?

1 Like

I imagine that, in principle, the same questions could be raised regarding the use of early access versions of Roon Bridge on dietpi for x86 and other architectures.

However, because Roon Bridge does not get updated very often (it has not changed in the time that I have been using Roon - about a year - and probably quite a bit longer) there is not usually a need to worry about such migrations because there is usually no early access version of Roon Bridge made available.

You are right in both points:

  • dietpi-software installs the stable version linked in the manual install section of the install docs you linked, without an option for the early access version.
  • It installs the binary files to /opt/roonserver and creates a systemd unit /etc/systemd/system/roonserver.service which sets /mnt/dietpi_userdata/roonserver as data dir, via environment variables. The Roon installer sets it up differently, hence is not compatible with this setup. However, you can of course run the installer on DietPi instead of installing Roon Server via dietpi-software.

The early access version is however available as archive just like the stable version: https://download.roonlabs.net/builds/earlyaccess/RoonServer_linuxx64.tar.bz2

So replacing the download link in dietpi-software should do it:

sed -i 's|RoonServer_linuxx64.tar.bz2|earlyaccess/RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software

I am not sure how large the interest for this is, but theoretically we could add a dietpi.txt setting and/or dialogue to choose between stable and early access version.

4 Likes

And presumably to go back to the production build it would be:

sed -i 's|earlyaccess/RoonServer_linuxx64.tar.bz2|RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software

For me, simply having these two scripts available would be good enough. I wouldn’t need a dietpi.txt setting.

However, a dietpi.txt setting may make things easier in principle. For example, I imagine the dietpi-software script could get overwritten when dietpi-update detects and installs a new version of dietpi whereas the dietpi.txt file (or at least its contents) would be preserved at least to the extent that its contents are compatible with the new version.

You can install it but need to make sure you set the environ variables for the install location etc to match Dietpis install as it uses customises it so it’s on your userdata drive and not where roon normally puts your data. If using the simple installer you need to edit that before running the install. If you don’t have it setup as the dietpi installer db won’t maintained on update.

Yes exactly, that would revert it, and also any dietpi-update would revert it. So for a persistent solution, a dietpi.txt setting or dialogue would be required.

@Simon_Arnold3 of course you could also edit the installer accordingly. But this would imply several things: Install dir, data dir, systemd service. And what works now might not work in the future if the installer is changed at some point. Editing a single URL in dietpi-software is easier and safer. Otherwise, I’d use the installer only, and not dietpi-software. The result is practically not so much different, to be true:

  • roonserver user vs root user (probably the biggest argument for DietPi)
  • /opt/roonserver vs /opt/RoonServer
  • /mnt/dietpi_userdata/roonserver vs /var/roon
  • /var/log/roonserver vs /var/roon/Logs
1 Like

So best solution is to edit the dietpi.txt with the path to EA download then? Or using sed?

At present, ‘sed’ is the only option to change the behaviour of dietpi-software.

@MichaIng was suggesting that a possible future enhancement may be to make dietpi-software look at a setting in dietpi.txt to determine which of the two download locations to use to get the manual install package.

2 Likes

Thanks Wade.

1 Like

To switchback I take it a dietpit-software reinstall of roonserver once switched back to use the main release via sed command will be needed? Won’t this also go over my current roonserver data in dietpi_userdata. Roons own installer doesn’t overwrite this data usually.

At present, I beleive it would be a procedure to switch between early access and production and vice versa like:

  1. Backup Roon Database just to be safe (as always)
  2. Uninstall Roon Server using dietpi-software
  3. Use the appropriate sed command to modify the dietpi-software script to use the repository of choice - early access or production
  4. Run dietpi-software to install Roon Server
  5. Restore Roon Database (if necessary).

So to go to early access, Step 3 sed command would be the command @MichaIng posted:

sed -i 's|RoonServer_linuxx64.tar.bz2|earlyaccess/RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software

To return to production, the Step 3 sed command would be

sed -i 's|earlyaccess/RoonServer_linuxx64.tar.bz2|RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software

The only wrinkle to this at present is that, whilst you want to stay on early access, you would have to re-run the Step 3 sed command to go to early access everytime you performed dietpi-update because such an update would restore the script to it’s non-early access variant as originally installed.

As far as the Roon Server data is concerned (the database), I’m not sure whether the script removes the database on uninstall or not. If it does not remove the database, then Step 5 will probably be unnecessary. Obviously, if it does, then Step 5 will be necessary to get back to where you were.

As I said right at the top of this thread, I, personally, have never moved to early access on DietPi. I only asked about this out of curiosity when then subject came up in a message exchange with another user.

Changing to and from early access in this household is just too impractical these day. I have too many people in the household using Roon and too many Roon installations to make it an easy or pleasant experience (The Roon Server (DietPi), 4 Windows Computers, 2 android tablets 4 android phones and, in principle, 3 RPi4s running Roon Bridge on DietPi as endpoints - although Roon Bridge hasn’t changed in all of the time that I have been using Roon).

Not sure that matters as once its installed via Dietpi-Software, Roon itsefl takes care of updates not dietpi so it would not chnage the install of ea even if dietpi updates and resets sed to the main release I updated mine to 9.4 recently and I am still recieving EA updates. Only if you wanted to use dietpi-install would it break and return you to release.

What I want to know if just using dietpi-software reinstall 157 after changing sed back to main release branch will just reinstall and not overwrite my data for roonserver in dietpi_userdata as thats where the database is.

I believe that the dietpi-software script detects the presence of the installed software so it doesn’t re-install it. That is why I suggested that uninstall was required first.

Not true if you use the reinstall command i believe it forces it, Uninstall removes the database unfortunatley when I did it last time.

True: explicitly running “dietpi-software reinstall 154” will overwrite the existing installation and keep the database intact.

Easier is this (to enable early access):

sed -i 's|builds/RoonServer_linuxx64.tar.bz2|builds/earlyaccess/RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software
systemctl stop roonserver
rm -R /opt/roonserver
dietpi-software reinstall 154

Respectively (to disable early access):

sed -i 's|earlyaccess/RoonServer_linuxx64.tar.bz2|RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software
systemctl stop roonserver
rm -R /opt/roonserver
dietpi-software reinstall 154

dietpi-software skips downloading and installing the archive, if an instance is installed already, referring to better use the internal updater. Does this actually make any sense? If an internal updater exists, I would prefer using it for updates, as it may do some additional backup or migration steps. However, practically, in all cases I checked, the updaters do nothing different than removing the old instance, installing the new one, and all migration steps are done on first service start after file replacement. So dietpi-software would not do anything different.

In any case, removing the old instance manually enforces dietpi-software to download a new one. This is also printed on the reinstall note, in case the instance is broken and needs to be repaired.

A reinstall won’t touch data and settings in any case. An uninstall indeed purges everything.

1 Like

I cant get it to switch back its still looking for EA,

Did you exit dietpi-software before retrying? The sed clearly replaces the string of the download URL. When copy&pasting, there is nothing which could go wrong.

I am not running dietpi-software only the command line version to install it and this is what happens. Following what you posted to the letter. I can install EA fine again not the main release.

I extied and tried it a few times and it always errors.

Please show the output of this:

grep 'RoonServer_linuxx64.tar.bz2' /boot/dietpi/dietpi-software
sed -n '/RoonServer_linuxx64.tar.bz2/p' /boot/dietpi/dietpi-software
sed -i 's|earlyaccess/RoonServer_linuxx64.tar.bz2|RoonServer_linuxx64.tar.bz2|' /boot/dietpi/dietpi-software
grep 'RoonServer_linuxx64.tar.bz2' /boot/dietpi/dietpi-software
sed -n '/RoonServer_linuxx64.tar.bz2/p' /boot/dietpi/dietpi-software

Ah lol, you used the sed to enable earlyaccess, please you the 2nd one (the one in the middle here) to disable it. It has the two pattern switched.