Skip to content

Bring the Shell Scripts Under Exit Status 64 and the Shell Interrupt Rule #1301

Done

Description

@ptr727

The resync's local review (#1294) found that this repo's shell scripts break the refreshed CODESTYLE.md "Command-Line Arguments" rule. A shell script that gives a refused argument an exit status of its own uses 64 (EX_USAGE) and reserves it. That rule has no next-edited exemption.

Scripts and what each owes

  • Docker/build.sh, Docker/install-debug-tools.sh, Docker/test.sh, Docker/version.sh: refuse with exit 2.
  • RegressionTests/integration-test.sh: refuses with exit 2, and also uses 2 for a work directory that already exists.
  • RegressionTests/regression-test.sh: refuses with exit 2, and also uses 2 for environment, mountpoint and dataset failures.

Each owes:

  • every refusal exits through one function that exits 64;
  • an EXIT trap that turns any other exit carrying 64 into 1;
  • --help naming the status;
  • a separate non-zero status for a run that started and failed.

What the edit pulls in

Under CODESTYLE.md "Interrupts", a script takes the interrupt rule when it is next edited. So each of these scripts also takes "Interrupts in Shell": INT and TERM traps that stop the script's children and re-raise the signal, the EXIT trap set before them, background children waited on with wait "$pid", and a mid-run signal test for each script holding a child or temporary state. regression-test.sh and integration-test.sh trap today with exit 130/143 or not at all, so their existing tests in RegressionTests/tests/test_regression_harness.py change from asserting 130/143 to asserting death by the signal.

Notes

Activity

  1. added
    pre-existing
    on Nov 26, 2026
  2. ptr727 commented on Nov 26, 2026

    @ptr727
    OwnerAuthor

    Done in #1307, merged into develop as 568a6e3. The sudo/ZFS run of regression-test.sh and the Docker image build remain the maintainer's verification on develop. Pre-existing follow-ups are #1305 and #1306.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pre-existing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions