rc.perp-boot 688 B

123456789101112131415161718192021222324252627282930313233343536
  1. #! /bin/sh -
  2. # rc.perp: perpd startup script for perpboot
  3. # ===
  4. set -e
  5. ### --- configure ---
  6. PERP_VAR=/var/run/perp
  7. PERPD_OPTS="-a6"
  8. ### --- script ---
  9. ## note: perpboot defines PERP_BASE on startup
  10. ## clean setup for runtime control files:
  11. rm -Rf ${PERP_VAR}
  12. mkdir -p ${PERP_VAR}
  13. chmod 0700 ${PERP_VAR}
  14. ## clean symlink:
  15. rm -Rf ${PERP_BASE}/.control
  16. ln -sf ${PERP_VAR} ${PERP_BASE}/.control
  17. ## exec perpd:
  18. ## * options as configured above
  19. ## * runchoom(8) abate linux oom-killer
  20. ## * runlimit(8) configured in ./rlimit.conf
  21. ## * PERP_BASE defined in environment by perpboot(8)
  22. exec \
  23. runchoom \
  24. runlimit -F ./rlimit.conf \
  25. perpd ${PERPD_OPTS} ${PERP_BASE}
  26. ### EOF