From d02a1d9a13bddd46db5fbe0522a0d96fca0facda Mon Sep 17 00:00:00 2001 From: Mike Pettypiece Date: Mon, 6 Apr 2026 16:27:06 -0400 Subject: [PATCH] fix: default shell executable to /bin/sh for Alpine compatibility (#241) The init hook executor defaulted to /bin/bash, which is not available on Alpine-based Docker images (eclipse-temurin:25-jre-alpine). This caused startup hooks to fail with "No such file or directory". /bin/sh is universally available and POSIX-compatible. --- docs/configuration/application-yml.md | 2 +- docs/configuration/initialization-hooks.md | 2 +- .../java/io/github/hectorvent/floci/config/EmulatorConfig.java | 2 +- src/test/resources/application.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/configuration/application-yml.md b/docs/configuration/application-yml.md index e082789aef..bcb5103929 100644 --- a/docs/configuration/application-yml.md +++ b/docs/configuration/application-yml.md @@ -42,7 +42,7 @@ floci: presign-secret: local-emulator-secret # HMAC secret for S3 pre-signed URL verification init-hooks: - shell-executable: /bin/bash + shell-executable: /bin/sh timeout-seconds: 30 shutdown-grace-period-seconds: 2 diff --git a/docs/configuration/initialization-hooks.md b/docs/configuration/initialization-hooks.md index 31130aebd7..dd42b4dd9b 100644 --- a/docs/configuration/initialization-hooks.md +++ b/docs/configuration/initialization-hooks.md @@ -117,7 +117,7 @@ You can customize hook behavior via configuration: | Key | Default | Description | |--------------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------| -| `floci.init-hooks.shell-executable` | `/bin/bash` | Shell executable used to run scripts | +| `floci.init-hooks.shell-executable` | `/bin/sh` | Shell executable used to run scripts | | `floci.init-hooks.timeout-seconds` | `30` | Maximum execution time per script before it is terminated and considered failed | | `floci.init-hooks.shutdown-grace-period-seconds` | `2` | Time to wait after calling `destroy()` before forcefully stopping the process (allows cleanup hooks to complete) | diff --git a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java index 1de28d5806..bfc6a2316a 100644 --- a/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java +++ b/src/main/java/io/github/hectorvent/floci/config/EmulatorConfig.java @@ -430,7 +430,7 @@ public interface EmulatorConfig { } interface InitHooksConfig { - @WithDefault("/bin/bash") + @WithDefault("/bin/sh") String shellExecutable(); @WithDefault("2") diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index fef33bb35c..573a9c151a 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -37,7 +37,7 @@ floci: presign-secret: test-secret init-hooks: - shell-executable: /bin/bash + shell-executable: /bin/sh timeout-seconds: 5 shutdown-grace-period-seconds: 2