rc.main 577 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! /bin/sh -
  2. #
  3. # socklog/rc.main
  4. #
  5. # Unix domain datagram socket for listening on /dev/log
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-socklog}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting socklog ..."
  14. exec /usr/sbin/socklog unix /dev/log
  15. }
  16. reset()
  17. {
  18. case $3 in
  19. exit)
  20. echo "*** ${SVNAME}: Exited status $4"
  21. ;;
  22. signal)
  23. echo "*** ${SVNAME}: Killed on signal $5"
  24. ;;
  25. *)
  26. echo "*** ${SVNAME}: Stopped (${3})"
  27. ;;
  28. esac
  29. }
  30. # Branch to target
  31. eval ${TARGET} "$@"