Just a couple of discoveries of the week: Backing up a system including Node-Red and the Ubuntu Segmentation Error…
You may recall we’ve been playing with a backup/sync solution using RSYNC whereby two identical Raspberry Pis or other (Neo Plus2 etc) can be kept in sync easily – great for when you have problems. In putting the script together to do this, we noted that it was necessary to exclude hosts and hostfile from the sync otherwise you’d end up with two systems on the network with the same hostname.
Well, that really doesn’t seem to cause any problems except for Node-Red. Inside the node-red folder are a pair of files – lets’ say the hostname is “fred” – there will be flows-fred.json and a flows-fred-cred.json files. These contain all the information about your flows – and your credentials used in those flows. Good idea but in this case I’d rather have generic names. Well, it turns out you can do that easily – there’s a line that should be commented out in the Node-Red settings.js file.
We’ve made a couple of lines to do this and to allow for prettyprinting at the same time. Consult the settings.js file but here’s what we’re adding into the script for the future.
sed -i -e 's#\/\/flowFile#flowFile#' /home/pi/.node-red/settings.js
sed -i -e 's#\/\/flowFilePretty#flowFilePretty#' /home/pi/.node-red/settings.js
i.e. just commenting out two lines in the settings.js file.
Also – I’ve been struggling with some FriendlyArm boards recently – the 64 bit ones running Ubuntu – every now and then when doing an apt-get upgrade, I would get a SEGMENTATION error. Now you try looking up a cure for this on Google. EXCEEDINGLY frustrating. Anyway, thanks to having the sync facility we’ve been able to create the fault – then backup to an earlier version over and over. Even doing something like installing NTP could trigger this off – always something to do with libc.bin. At first I thought it was the WiringNP that FriendlyArm install on some of their boards but now that is looking like a dead theory.
So tonight, Antonio and I have been playing around and he came to the conclusion that it might be to do with the libc.bin they install – 2.23
To test the theory, Antonio came up with this lot below. Don’t blame me if it screws up your computer and don’t use this unless you have the segmentation error issue (I suspect you don’t but I want this writing down somewhere).
dpkg -i locales*
dpkg -i libc6*
dpkg -i libc-bin*
dpkg -i libc-dev-bin*
dpkg -i libc6-dev*
dpkg -i linux-libc-dev*
dpkg -i locales*
dpkg --configure –a
That little lot upgraded libc to 2.26 and up to now – the issue has gone away – I’ve installalled all sorts of things on the PLUS2 without issue.