💡 Idea for a debugging script 💡

This might already exist for FreeBSD, and if so… let me know!

    1. keeps record of OS core/default settings: loader.conf, rc.conf, sysctl.conf, devfs.rules, login.conf etc
    1. keeps record of file checksum on those OS core files (similar to the app, tripwire)
    1. mode which shows divergence on current state vs known-default state in configs (1) and checksums (2)
      -4) mode which tracks the files and their change-sets over time, similar to a zfs snapshot but at a single file-level

#freebsd #scripting #programming

  • @winterschon@bsd.cafe I think 1-3 are covered by freebsd-update IDS. 4 would be nice to add.

    In my ideal world, we’d separate out the bits in /etc that users touch from the ones that are provided by the system and allow /etc to be a separate ZFS dataset. Unfortunately, the lack of this separation means /etc doesn’t get mounted if you try because the scripts that mount all of the non-root ZFS datasets are in /etc.

          • Eva Winterschön@mastodon.bsd.cafeOP
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            @david_chisnall@infosec.exchange generally I agree. the only systems where I bother with UFS are embedded devices with minimal ram, read-only systems which load everything into ram at boot (BSD-RP), or devices which are limited to SD or CF flash (storage appliances, some which have a super minimal freebsd image deployed on Dell IDSDM, which then hand-off to multipath LUN for centralized control of the storage nodes), and the less exciting: a few old switches and firewalls that seem to never die.

            the general reason that I mentioned UFS in this context is less about systems which don’t use ZFS, rather that the idea for a design of this minimal tool is maintaining portability independent of the underlying FS. which is to say, if ZFS isn’t there, then its snapshot system is not a design consideration. some of those system that I mentioned have needed a lightweight debugging toolkit during the hardware development lifecycle, where the full OS being functional is not yet a concern.

            sometimes it’s a case of ZFS tools not yet being available because of a kernel panic, and I want sorta-automated analysis which led up to that stage of failure. it’s tedious to track and report the boot stage options, changes, minutiae differences across ten or twenty rapid reboots. scripting those repetitive tasks along with a remote kgdb hookup to an alt-machine on serial is what I’ve been doing lately, but was hoping there was a pre-made “very simple” test harness tool available for similar purposes.

    • Eva Winterschön@mastodon.bsd.cafeOP
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      @david_chisnall@infosec.exchange yes, proper observations there, and a coincidence that you mentioned /etc as a separate dataset. I’ve been splitting that off on some dev machines which do not use the regular installer for setup, for these reasons. Also for /use/local and /usr/local/etc during a post-install automation stage.

      I’m not sure if that conflicts with design concerns used in the default installation, but it’s helpful for tracking configuration changes separate from the rest of base.

      Now I’m looking at the src involved with freebsd-update 👍🏻

      • @winterschon@bsd.cafe Oh, does that boot now? It didn’t last time I tried: without /etc mounted, you can’t mount other filesystems. I guess the kernel is doing slightly more for ZFS mounts on boot than it used to (doesn’t work for non-ZFS systems because fstab is in /etc, it used to also not work for ZFS, I think, because something in rc.d was needed to mount additional filesystems).