Skip to content

TOOLS-3662: ship astools.conf via copy-if-absent install script - #83

Merged
a-spiker merged 2 commits into
mainfrom
TOOLS-3662-astools-conf-support
Jul 24, 2026
Merged

TOOLS-3662: ship astools.conf via copy-if-absent install script#83
a-spiker merged 2 commits into
mainfrom
TOOLS-3662-astools-conf-support

Conversation

@a-spiker

Copy link
Copy Markdown
Contributor

What

Standalone tool packages ship no astools.conf, so a fresh install leaves the user without the config template. This adds it back without re-introducing conffile-ownership conflicts with the aerospike-tools bundle.

  • New pkg/astools.conf.sample: byte-identical copy of the canonical etc/astools.conf template.
  • New pkg/postinst.sh (deb --after-install + --after-upgrade, rpm %post): seeds /etc/aerospike/astools.conf from /opt/aerospike/doc/aql/astools.conf.sample only when the file is absent.
  • New pkg/mac-scripts/postinstall: same copy-if-absent logic for the macOS .pkg, target-volume aware.
  • pkg/Makefile: stage the owned sample under /opt/aerospike/doc/aql/ (mac: /usr/local/aerospike/doc/aql/); wire the scripts.
  • Removed the stale, unreferenced pkg/astools.conf.

The live /etc/aerospike/astools.conf is deliberately not owned by the package. Result: standalone tools and the aerospike-tools bundle coexist with no dpkg/rpm conflict over the path, and user edits are never touched.

Wired as both --after-install and --after-upgrade: fpm's deb template routes an install-only hook into after_upgrade() that never runs on upgrade or reinstall, so both are required for existing installs to get the file.

Tests

New .github/bin/test/test_astools_conf.bats runs in the linux and mac install jobs (kept out of the shared test_execute.bats, which is reused by the docker smoke job on the host):

  • file created on install and matches the sample
  • file recreated after removal + reinstall (guards the after-upgrade wiring)
  • user edits survive reinstall

Docker smoke test asserts the image carries /etc/aerospike/astools.conf.

TOOLS-3662

a-spiker added 2 commits July 19, 2026 11:37
Ship the shared astools.conf template as an owned sample under /opt/aerospike/doc/aql/ and seed /etc/aerospike/astools.conf from it only when the file is absent (deb/rpm post-install and macOS pkgbuild postinstall). The live file is deliberately not owned by the package, so the standalone tools and the aerospike-tools bundle coexist without conffile conflicts and user edits survive upgrades. Wired as both --after-install and --after-upgrade because fpm's deb template runs an install-only hook only on fresh configure.

TOOLS-3662
The el8 minimal container has no cmp (diffutils); use a coreutils cat comparison instead so the content check runs everywhere.

@pvinh-spike pvinh-spike left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@a-spiker
a-spiker merged commit 9690a95 into main Jul 24, 2026
22 checks passed
@a-spiker
a-spiker deleted the TOOLS-3662-astools-conf-support branch July 24, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants