Skip to content

Commit

Permalink
fix: execute correct %appstart script with instance start --app
Browse files Browse the repository at this point in the history
Fixes: #2410
  • Loading branch information
dtrudg committed Nov 29, 2023
1 parent 6d090ae commit 596fe35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
given the `--app <appname>` flag, and will automatically invoke the relevant
SCIF command.

### Bug Fixes

- Execute correct `%appstart` script when using `instance start` with `--app`.

## 4.0.2 \[2023-11-16\]

### Changed defaults / behaviours
Expand Down
8 changes: 7 additions & 1 deletion internal/pkg/util/fs/files/action_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@ test)
sylog info "No test script found in container, exiting"
exit 0 ;;
start)
if test -x "/.singularity.d/startscript"; then
if test -n "${SINGULARITY_APPNAME:-}"; then
if test -x "/scif/apps/${SINGULARITY_APPNAME:-}/scif/startscript"; then
exec "/scif/apps/${SINGULARITY_APPNAME:-}/scif/startscript" "$@"
fi
sylog error "No startscript for contained app: ${SINGULARITY_APPNAME:-}"
exit 1
elif test -x "/.singularity.d/startscript"; then
exec "/.singularity.d/startscript" "$@"
fi
Expand Down

0 comments on commit 596fe35

Please sign in to comment.