run 363 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. user=logger
  3. logdir="/var/log/service/`(cd ..;basename $PWD)`"
  4. mkdir -p "$logdir" 2>/dev/null
  5. chown -R "$user": "$logdir"
  6. chmod -R go-rwxst,u+rwX "$logdir"
  7. rm -rf logdir
  8. ln -s "$logdir" logdir
  9. # make this dir accessible to logger
  10. chmod a+rX .
  11. exec >/dev/null
  12. exec 2>&1
  13. exec \
  14. env - PATH="$PATH" \
  15. softlimit \
  16. setuidgid "$user" \
  17. svlogd -tt "$logdir"