New home / New start

After 7 years faithful service, its about time to retire the 2nd incarnation of my home based server. This one has gone thru about 7 different FreeBSD builds and despite various fun and games regarding loss of disk space, which turned out to be the large ZFS snapshots taken every time FreeBSD had a major upgrade its performed tirelessly.

I will keep the M58 on as backup, but no longer needed to keep my feet warm running under my desk 24/7 and reduce my household electric bill a little.

Its also time to start house-hunting again after 3 happy years in the flat, but its time to move on, so also not needing to find a cubby hole in a new house with Cat6 , power and ventilation is also one less worry. Its probably means I won’t have as much to post about as keeping the server regularly patched and upgrade has been how I have self taught myself most of my Unix/Linux experience, but does mean I don’t need to worry if an upgrade fails and work late into the night to rebuild it any more.

Disk space solved – ZFS snapshots – DRAFT

Finally resolved the diminishing lack of free disk space for future FreeBSD updates. It seems that since version xx.x each upgrade as made a ZFS snapshot taking 1-3Gb each for each successive version. As the hardware has been running since 2017 that’s an awful lot of major and point revision snapshots.

DU and DF hid those successive snapshots and I was blaming my ever expanding OneDrive offline sync for taking excessive amounts of disk space even though I was convinced I had move the sync folder to the slave disk some time ago.

As I have never needed to roll back a ZFS snapshot I had never needed to explore what amount of space they took, or even how to display their usage, even less so how to delete them. Necessity being the mother of all invention, or least the need for a proper Google session I finally found the commands and confidence to delete 12 previous incarnations of FreeBSD and give me back the free disk I need to apply the next edition of FreeBSD.

Python updated to 3.11

Might have found my Rust 1.78/1.79 is not building, as checking the dependencies, it wants Python 3.11, but my make.conf file holds python at 3.9. Not sure why Postmaster was not complaining at build time with a more helpful error message, but this seems a good place to start, so now off to rebuild Python.

20240529:

  AFFECTS: users of python

  AUTHOR: rm@FreeBSD.org

  The default version of python3 and python was switched to 3.11.

  For ports users wanting to keep version 3.9 as default,

  add DEFAULT_VERSIONS+= python=3.9 python3=3.9 to make.conf

  Following procedures may ease the upgrade:

  For users of pre-build packages:

  # sh

  # for i in $(pkg query -g %n ‘py39-*’); do pkg set -yn ${i}:py311-${i#py39-}; done

  # pkg upgrade

  For portmaster users:

  # sh

  # portmaster -o lang/python311 python39

  # REINSTALL=”$(pkg info -oq ‘*py39*’)”

  # pkg delete -f “*py39*”

  # portmaster $REINSTALL

  # REBUILD=$(pkg query -g “%n:%dn” ‘*’ | grep py3 | grep -v py311 | cut -d : -f 1 | sort -u)

  # portmaster $REBUILD

  # REBUILD2=$(pkg list | grep python-39 | xargs pkg which | awk ‘{print $6}’ | sort -u)

  # portmaster $REBUILD2

  Final steps (for pre-built packages & portmaster):

  If no longer required, Python 3.9 can be removed via

  “pkg remove python39” and the directory /usr/local/lib/python3.9 can

  then be deleted afterwards, if not empty.

Rust 1.78 will not build

Free disk space continues to be an issue, I’ve deleted 50Gb of backups but df -h has yet to recognise the new free space. This would not be an issue apart from Rust and Cargo-c appear to want to use up all available free disk space.

I also noted a discrepancy between the Pkg Info command to re-port out of date packages/ports and those that postmaster -da then tried to build as being out of date.

If I manage to resolve these issues I will update this post.

Disk space usage troubles

Whilst trying to update some common ports I keep running out of disk space, causing the Database to halt and then the website to fail. Struggling to find out which package is consuming excessive disk space and fear I need to drop down to single user mode to run fsck (but meaning I need to find a VGA cable and suitable monitor to hook up to ) so seeing which packages consume the most and may be able to go, so run.

pkg info -sa | sort -hk2

FreeBSD – Updating Ruby

The default version of Ruby has been bumped to 3.2, which is fine, but /UPDATING no longer includes the steps needed to bump your installed version.

No problem, just scroll down to see what the instructions were for the last revision bump. And then you hit a problem. All the Ruby port bumps refer you to the 2019 entry, which is fab , stepping thru instructions of how to move from 2.4 to 2.5. , however, UPDATING no longer goes all the way back to 2019. It’s been trimmed. A bit of googling and a found the unedited version of UPGRADING which helpfully had the instructions, which for ease I have pasted below and for even easier usage, have amended the instructions for moving between 3.1 and 3.2

20190420:
  AFFECTS: users of lang/ruby24
  AUTHOR: mfechner@FreeBSD.org

The default ruby version has been updated from 2.4 to 2.5.

If you compile your own ports you may keep 2.4 as the default version by adding the following lines to your /etc/make.conf file:

#
  # Keep ruby 2.4 as default version
  #
  DEFAULT_VERSIONS+=ruby=2.4

If you wish to update to the new default version, you need to first stop any software that uses ruby. Then, you will need to follow these steps, depending upon how you manage your system.

If you use pkgng, simply upgrade:
  # pkg upgrade

If you use portmaster, install new ruby, then rebuild all ports that depend on ruby:
  # portmaster -o lang/ruby25 lang/ruby24
  # portmaster -R -r ruby-2.5

If you use portupgrade, install new ruby, then rebuild all ports that depend on ruby:

# pkg delete -f ruby portupgrade
  # make -C /usr/ports/ports-mgmt/portupgrade install clean
  # pkg set -o lang/ruby24:lang/ruby25
  # portupgrade -x ruby-2.5.\* -fr lang/ruby25

and upgraded version is

20240306:
  AFFECTS: users of lang/ruby31
  AUTHOR: me!

The default ruby version has been updated from 3.1 to 3.2.

If you compile your own ports you may keep 3.1 as the default version by  adding the following lines to your /etc/make.conf file:


  DEFAULT_VERSIONS+=ruby=3.1

If you wish to update to the new default version, you need to first stop any software that uses ruby. Then, you will need to follow these steps, depending upon how you manage your system.

If you use pkgng, simply upgrade:
  # pkg upgrade

If you use portmaster, install new ruby, then rebuild all ports that depend on ruby:
  # portmaster -o lang/ruby32 lang/ruby31
  # portmaster -R -r ruby-3.2

If you use portupgrade, install new ruby, then rebuild all ports that depend on ruby:

# pkg delete -f ruby portupgrade
  # make -C /usr/ports/ports-mgmt/portupgrade install clean
  # pkg set -o lang/ruby31:lang/ruby32
  # portupgrade -x ruby-3.2.\* -fr lang/ruby32

Apple and FreeBSD update

The update to PERL also managed to break SSL, with no clear culprit of what had failed. rebuilding all the of PERL dependencies did little to fix it. and oddly Apache still tried to serve up the webpages but in plain text on the internal network.

Going thru the Freebsd-update fetch and install route and rebuilding OpenSSL once the patch update had been applied allow Apache to once again happily serve up the site pages.

iOS 17 is not far away from being launched but I have been running the Beta’s on phone, iPad, Watch and AppleTV quite happily for a month now. After upgrading the AppleTV the big screen FaceTime is a bonus but watching the Apple Launch event now sure I need the finger double tap for the watch or the USB-C connections for iPhone so will wait to see how the prices pan out or if a battery replacement on each will buy another year of service and see what next September brings.

Updating Perl to 5.34

The UPDATING readme for successfully updating all the Perl modules when the default version takes a revision bump is helpful, but could be a damm site more helpful if they just re-posted the original advice, its not as its its pages and pages.

Anyway here is my link to the amended commands to effect the upgrade.

Link to Page

GoAccess parsing issues resolved

Since Webalizer fell into disrepair some years ago, I dabbled with GoAccess for website stats and sort of got it working. Several OS or Apache updates later it decided to stop working and I never found the time to fix.

Well, todays persistent rain and nothing better to do, I resolved to fix why GoAccess refused to parse my Apache logs.

The initial fault seemed to stem from GoAccess not being able to decide if I had CLF ( Common Log Format) or Combined Log Format. Apache was insistent that I had set Combined Log Format looking at httpd.conf, but GoAccess complained on start-up that this was not the case.

As this is a hobby server and I had not needed to rotate the logs for several years I can only guess the httpd-access.log had been corrupted or mixed with CLF at some point, so a forced log rotation stopped the error messages on startup and allowed the basic details of the log to be parsed.

However the referrer and user agent still was not parsed. It seems there is a error in the sample goaccess.conf file and the %R and %u fields need double quotes to be parsed fully. A post way back from 2014 seemed to flag this but the MAN page still does not pick this up, maybe its a FreeBSD specific issues

Anyhoo, fixing this is the Combined Log file format parse string now has the file being parsed happily. The OS and Browser detections still seem a bit pants, Safari and Apple iOS and MacOS seemed to be lumped under Linux, but job for another day.

The analytics can be found here