rc.log-boot 658 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/sh -
  2. # rc.log: perpd logger script for perpboot
  3. # ===
  4. ### --- configure ---
  5. ## required:
  6. LOGDIR=/var/log/perpd
  7. LOGOPTS="-k 8 -s 100000 -t -z"
  8. ## suggested:
  9. LOGUSER=log
  10. ### --- script ---
  11. ## initialize user:
  12. if id ${LOGUSER} >/dev/null 2>/dev/null ; then
  13. my_uid=$(id -u ${LOGUSER})
  14. my_gid=$(id -g ${LOGUSER})
  15. else
  16. LOGUSER=$(id -un)
  17. my_uid=$(id -u ${LOGUSER})
  18. my_gid=$(id -g ${LOGUSER})
  19. fi
  20. ## initialize logdir:
  21. if ! test -d ${LOGDIR} ; then
  22. mkdir -p ${LOGDIR}
  23. fi
  24. chown -R ${my_uid}:${my_gid} ${LOGDIR}
  25. chmod 0755 ${LOGDIR}
  26. ## exec tinylog with privilege drop:
  27. exec \
  28. runuid ${LOGUSER} \
  29. tinylog ${LOGOPTS} ${LOGDIR}
  30. ### EOF