Skip to content

feat(install): install.sh for the source tarball distribution #1090

@markuslf

Description

@markuslf

Ship an install.sh in the source zip (and as a curl-able standalone) that automates the manual post-install steps currently documented in INSTALL.md > "Source Tarball". Targets air-gapped hosts and environments that cannot or do not want to reach the Linuxfabrik package repository.

Target one-liner:

curl -fsSL https://download.linuxfabrik.ch/monitoring-plugins/install.sh | sudo bash

Alternative: run ./install.sh from the unpacked source zip.

Script responsibilities:

  • Read /etc/os-release to pick the plugin user (icinga on RHEL and SLE, nagios on Debian and Ubuntu) and the matching sudoers drop-in from assets/sudoers/.
  • Download and unzip lfmp-<version>-<iteration>.source.noarch.zip into /usr/lib64/nagios/plugins/. Version selectable via flag or LFMP_VERSION env.
  • Install Python dependencies as the plugin user. Preferred: build a venv at /usr/lib64/linuxfabrik-monitoring-plugins/venv/ and rewrite plugin shebangs, so the source install matches the RPM and DEB layout. Fallback: pip install --user --require-hashes --requirement requirements.txt.
  • Install the OS-family-appropriate sudoers file to /etc/sudoers.d/linuxfabrik-monitoring-plugins.
  • On RHEL with enforcing SELinux, run restorecon -Fvr /usr/lib64/nagios and setsebool -P nagios_run_sudo on.
  • Support --uninstall to reverse everything cleanly. Idempotent on re-runs.

Delivery:

  • Script source under tools/install-source in this repo, included in the source zip by build/create-src-tarball.sh.
  • Deployed standalone to https://download.linuxfabrik.ch/monitoring-plugins/install.sh with sha256 checksum and detached GPG signature.
  • Script starts with set -eu -o pipefail, honors DRY_RUN=1, exits non-zero on unsupported distributions.

Relationship to #1089:

  • OS detection and sudoers placement are identical; factor into a shared snippet or helper to keep both scripts aligned.

Docs (INSTALL.md):

  • Replace the manual chmod / pip / sudoers / SELinux steps in "Source Tarball" with the one-liner form plus a "download first, review, then run" variant.

Metadata

Metadata

Assignees

Labels

buildPackaging, build scripts, distribution artifacts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions