rc.main 610 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #! /bin/sh -
  2. #
  3. # cupsd/rc.main
  4. #
  5. # CUPS scheduler.
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-cupsd}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting cupsd ..."
  14. # Check first if 'dbus' is running before to run 'cupsd'
  15. perpok dbus || exit $?
  16. exec /usr/sbin/cupsd -f
  17. }
  18. reset()
  19. {
  20. case $3 in
  21. exit)
  22. echo "*** ${SVNAME}: Exited status $4"
  23. ;;
  24. signal)
  25. echo "*** ${SVNAME}: Killed on signal $5"
  26. ;;
  27. *)
  28. echo "*** ${SVNAME}: Stopped (${3})"
  29. ;;
  30. esac
  31. }
  32. # Branch to target
  33. eval ${TARGET} "$@"