Pending Setups is a Bash-based utility designed to manage and execute setup scripts for Zextras products (particularly Carbonio). It provides an interactive menu system to track and run pending configuration scripts, ensuring that system setups are performed in a controlled and logged manner.
The utility monitors a dedicated directory (/etc/zextras/pending-setups.d/) for setup scripts and provides both interactive and automated execution modes. All operations are logged for audit purposes, with automatic log rotation to maintain system health.
- Docker or Podman installed
- Make
# Build packages for Ubuntu 22.04
make build TARGET=ubuntu-jammy
# Build packages for Rocky Linux 9
make build TARGET=rocky-9
# Build packages for Ubuntu 24.04
make build TARGET=ubuntu-nobleubuntu-jammy- Ubuntu 22.04 LTSubuntu-noble- Ubuntu 24.04 LTSrocky-8- Rocky Linux 8rocky-9- Rocky Linux 9
You can customize the build by setting environment variables:
# Use a specific container runtime
make build TARGET=ubuntu-jammy CONTAINER_RUNTIME=docker
# Use a different output directory
make build TARGET=rocky-9 OUTPUT_DIR=./my-packagesThis package is distributed as part of the Carbonio platform. To install:
sudo apt-get install ./artifacts/pending-setups*.debsudo yum install ./artifacts/pending-setups*.rpmThe pending-setups command must be run as root. It provides both interactive and non-interactive modes.
Simply run the command without arguments to launch the interactive menu:
sudo pending-setupsThis will display a menu showing all pending setup scripts. You can:
- Select individual scripts to execute by entering their number
- Press
ato execute all pending setups - Press
qto quit
Execute all pending setups without user interaction (useful for automation):
sudo pending-setups --execute-all
# or
sudo pending-setups -apending-setups --help
# or
pending-setups -hThe utility manages setup scripts in the following locations:
/etc/zextras/pending-setups.d/- Place new setup scripts here (must be.shfiles)/etc/zextras/pending-setups.d/done/- Successfully executed scripts are moved here/var/log/pending-setups/- Log files are stored here
Setup scripts placed in /etc/zextras/pending-setups.d/ must:
- Have a
.shfile extension - Be executable
- Return exit code
0on success (script will be moved todone/) - Return non-zero exit code on failure (script will be kept for retry)
The utility can work with Consul token authentication for Zextras products:
- Set the
SETUP_CONSUL_TOKENenvironment variable before running - Or let the utility prompt for credentials and retrieve the token automatically
All executions are logged to /var/log/pending-setups/ with ISO 8601 timestamps. The utility automatically maintains the 100 most recent log files, deleting older ones.
# Place a setup script in the pending directory
sudo cp my-setup-script.sh /etc/zextras/pending-setups.d/
# Run pending-setups
sudo pending-setups
# You'll see:
# You have 1 pending setups to run
# 0) my-setup-script.sh
#
# a) execute all
# q) quit
#
# Please input your selection:
# >
# Enter 0 to execute the script, or 'a' to execute allWe welcome contributions! See CONTRIBUTING.md for information on how to contribute to this project.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE.md file for details.