turnkeylinux / tracker

TurnKey Linux Tracker
https://www.turnkeylinux.org
71 stars 16 forks source link

LXC appliance version-seeking bug #971

Closed JedMeister closed 6 years ago

JedMeister commented 6 years ago

NOTE: This bug can be closed when #878 is resolved for v15.0


It looks like my last minute tweak to the LXC appliance broke it's version seeking... :cry:

I obviously didn't test that enough...

As you can see the original code was:

cat /etc/turnkey_version | cut -d'-' -f3,4

which on the current LXC appliance would return:

14.2-jessie

But many appliances have multi-part appliance names such as asp-net-apache (the above code would return net-apache for that). So I added "more robust version seeking":

cat /etc/turnkey_version | perl -pe 's/.*-([^-]+(-[^-]+){2})$/\1/')

but that returns

14.2-jessie-amd64

It should have instead been:

cat /etc/turnkey_version | perl -pe 's/.*-([^-]+(-[^-]+){1})-.*$/\1/'

But actually, seeing as this code only runs on the LXC host appliance, the original code (using cut) was actually fine! So I should have just left it alone... (or better still, we could have implemented #878).


Workaround

To revert to the previous code, please run this:

sed -i.bak "\|cat /etc/turnkey_version| s|perl.*|cut -d'-' -f3,4)|" /usr/share/lxc/templates/lxc-turnkey

Assuming that everything works now, you can remove the backup config file:

rm /usr/share/lxc/templates/lxc-turnkey.bak
JedMeister commented 6 years ago

I've just reverted the commit that introduced this bug. We'll aim to properly fix the issue via #878, but in the meantime, this specific issue is closed via https://github.com/turnkeylinux-apps/lxc/commit/c6e97db46a34a826759f43faf7e33e97ca582b72