fix-attrs 661 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh -e
  2. got=0
  3. err=0
  4. if profile=`printcontenv S6_RUNTIME_PROFILE` ; then
  5. etc="/etc/cont-profile.d/$profile"
  6. else
  7. etc=/etc
  8. fi
  9. apply () {
  10. echo "[s6-overlay] fix-attrs: applying $1"
  11. got=1
  12. if ! /package/admin/s6-overlay-@VERSION@/libexec/fix-attrs < "$1" ; then
  13. err=1
  14. fi
  15. }
  16. for file in `s6-ls "$etc/fix-attrs.d" 2>/dev/null | s6-sort` ; do
  17. apply "$etc/fix-attrs.d/$file"
  18. done
  19. if test "$got" -ne 0 ; then
  20. echo '[s6-overlay] fix-attrs: warning: fix-attrs is deprecated, please fix volume permissions in Dockerfile instead' 1>&2
  21. fi
  22. if test "$err" -ne 0 && b=`printcontenv S6_BEHAVIOUR_IF_STAGE2_FAILS` && test "$b" -eq 2 ; then
  23. exit 1
  24. fi