github.com/singularityware/singularity@v3.1.1+incompatible/etc/actions/run (about)

     1  #!/bin/sh
     2  
     3  for script in /.singularity.d/env/*.sh; do
     4      if [ -f "$script" ]; then
     5          . "$script"
     6      fi
     7  done
     8  
     9  if test -n "${SINGULARITY_APPNAME:-}"; then
    10  
    11      if test -x "/scif/apps/${SINGULARITY_APPNAME:-}/scif/runscript"; then
    12          exec "/scif/apps/${SINGULARITY_APPNAME:-}/scif/runscript" "$@"
    13      else
    14          echo "No Singularity runscript for contained app: ${SINGULARITY_APPNAME:-}"
    15          exit 1
    16      fi
    17  
    18  elif test -x "/.singularity.d/runscript"; then
    19      exec "/.singularity.d/runscript" "$@"
    20  else
    21      echo "No Singularity runscript found, executing /bin/sh"
    22      exec /bin/sh "$@"
    23  fi