run-log 489 B

1234567891011121314151617181920212223242526
  1. #!/bin/execlineb -PS0
  2. backtick -n -D "${1}" -E sv {
  3. pipeline { echo "${1}" }
  4. sed "s/-log$//"
  5. }
  6. unexport DIRECTIVES
  7. unexport S6_LOG_DIR
  8. envfile -I /etc/s6/config/global-log.conf
  9. envfile -I "/etc/s6/config/${sv}.conf"
  10. multisubstitute {
  11. importas -sCuD "n3 s2000000 T" -S DIRECTIVES
  12. importas -uD "/run/log" -S S6_LOG_DIR
  13. }
  14. define log "${S6_LOG_DIR}/${sv}"
  15. foreground { install -m750 -d -o s6log -g s6log "${log}" }
  16. s6-setuidgid s6log
  17. exec -c
  18. s6-log -d3 -b -- ${DIRECTIVES} "${log}"