/rc1.d/K20kerneloops

http://github.com/brinkman83/bashrc · Shell · 94 lines · 56 code · 15 blank · 23 comment · 4 complexity · 4295e0b4136f989b022b3c2475866519 MD5 · raw file

  1. #!/bin/sh
  2. #
  3. # kerneloops
  4. #
  5. # chkconfig: 345 90 88
  6. # description: A tool that collects and submits kernel crash \
  7. # signatures to the kerneloops.org website for use by the Linux \
  8. # kernel developers.
  9. # processname: kerneloops
  10. # config: /etc/kerneloops.conf
  11. #
  12. ### BEGIN INIT INFO
  13. # Provides: kerneloops
  14. # Default-Start: 2 3 4 5
  15. # Default-Stop: 1
  16. # Required-Start: $local_fs $remote_fs $named $network $time $syslog
  17. # Required-Stop: $local_fs $remote_fs $syslog
  18. # Short-Description: Tool to automatically collect and submit kernel crash signatures
  19. # Description: A tool that collects and submits kernel crash
  20. # signatures to the kerneloops.org website for use by the Linux
  21. # kernel developers.
  22. ### END INIT INFO
  23. # Source function library.
  24. . /lib/lsb/init-functions
  25. exec="/usr/sbin/kerneloops"
  26. prog=$(basename $exec)
  27. service="Kernel Oops catching service"
  28. pidfile=/var/run/$prog.pid
  29. sconf="/etc/kerneloops.conf"
  30. enabled=1
  31. [ -x "$exec" ] || exit 0
  32. [ -e /etc/default/$prog ] && . /etc/default/$prog
  33. [ "$enabled" = "1" ] || exit 0
  34. start() {
  35. log_daemon_msg "Starting $service" "$prog"
  36. start-stop-daemon --start --quiet --oknodo --chuid kernoops:adm --pidfile $pidfile --exec $exec
  37. retval=$?
  38. pidof -s kerneloops > $pidfile
  39. log_end_msg "$retval"
  40. return $retval
  41. }
  42. stop() {
  43. log_daemon_msg "Stopping $service" "$prog"
  44. start-stop-daemon --stop --quiet --oknodo --pidfile $pidfile
  45. retval=$?
  46. rm -f $pidfile
  47. log_end_msg "$retval"
  48. return $retval
  49. }
  50. restart() {
  51. stop
  52. start
  53. }
  54. reload() {
  55. restart
  56. }
  57. force_reload() {
  58. restart
  59. }
  60. fdr_status() {
  61. status_of_proc -p $pidfile $prog "$service"
  62. }
  63. case "$1" in
  64. start|stop|restart|reload)
  65. $1
  66. ;;
  67. force-reload)
  68. force_reload
  69. ;;
  70. status)
  71. fdr_status
  72. ;;
  73. condrestart|try-restart)
  74. pidof kerneloops >/dev/null || restart
  75. ;;
  76. *)
  77. echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
  78. exit 1
  79. esac