"Reinstalling" basejail in ezjail to fix complicated problems

So sometime back, when it was time to move up from 11-RELEASE to 12-RELEASE, I was careless with the upgrading of my ezjail system, and broke something. As I wasn't using any of the jails at the time, I did not notice the problem when I should have (and when it should have been fixable). A couple more upgrades have passed between the 11-12 migration and now, and the commands for upgrading ezjail did not complain in the interim. Everything indicated the jails were up-to-date.

I noticed the problem only recently when I needed the jails again. I wanted to upgrade one of the jailed pkgs and got the familiar error of
Code:
Shared object "libarchive.so.7" not found, required by "pkg"
. I tried many/most of the proposed solutions on this forum and elsewhere (SE) to fix it, and nothing worked. Postgres was installed in one of the jails, and as it had not automatically started, I issued the command to launch the service and got a similar *shared object __ not found, required* error. Finally, I wanted to reinstall pkg from the port. Issuing make anything gave a strange error
Code:
make: "/basejail/usr/share/mk/sys.mk" line 294: Could not find bsd.suffixes.mk
make: Fatal errors encountered -- cannot continue
make: stopped in /basejail/usr/ports/ports-mgmt/pkg

I have no clue what bsd.suffixes.mk is and the *13* results on it were not easy enough for me to follow. There were zero results for "could not find bsd.suffixes.mk", so I figured I must have something truly and arcanely terrible. I tried creating a new jail but that too had same problems as the old - not too surprising by this point given the depth of the fuckup.

On a whim and out of desperation (I had already spent way too long on what I expected to be an hour at most - to just update the jailed pkgs), I decided to simply ezjail-admin install again - hoping that when it fetches and writes the base.tzx again, it should do it right.
Surprisingly, it seems to have worked - in the sense that it led to the solvable problem here (solution: pkg delete -f pkg and pkg update -f pkg). And now things *seem* to be back to normal, essential jailed services (e.g. postgres) seem to work (still checking the rest).

I wrote this story partly because given the depth of the problem, I have no idea what I just did.
More importantly, the question is, is this a reliable/failsafe/foolproof way to update ezjails? While I will of course take better care in upgrading jails in the future, in the event something goes wrong during a future upgrade (judging the number of commonly reported problems, it is not too unlikely), is this method reinstalling the basejail (and possibly pkg) a reliable enough method to be put into my "disaster" (jailed webservers/db not starting counts as a virtual disaster) recovery plan?
 

Attachments

  • Screen Shot 2020-05-05 at 07.56.20.png
    Screen Shot 2020-05-05 at 07.56.20.png
    49.2 KB · Views: 80
  • Screen Shot 2020-05-05 at 07.55.31.png
    Screen Shot 2020-05-05 at 07.55.31.png
    148.3 KB · Views: 72
Back
Top