monit.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. Index: files.c
  2. --- files.c.orig 2003-10-25 21:17:10.000000000 +0200
  3. +++ files.c 2003-10-27 15:23:38.000000000 +0100
  4. @@ -160,8 +160,8 @@
  5. /**
  6. * Search the system for the monit control file. Try first ~/.monitrc,
  7. - * if that fails try /etc/monitrc and finally ./monitrc. Exit the
  8. - * application if the control file is not found.
  9. + * if that fails try @l_prefix@/etc/monit/monitrc and finally ./monitrc.
  10. + * Exit the application if the control file is not found.
  11. * @return The location * of monits control file (monitrc)
  12. */
  13. char *find_rcfile() {
  14. @@ -177,7 +177,7 @@
  15. }
  16. memset(rcfile, 0, STRLEN);
  17. - snprintf(rcfile, STRLEN, "/etc/%s", MONITRC);
  18. + snprintf(rcfile, STRLEN, "@l_prefix@/etc/monit/%s", MONITRC);
  19. if(exist_file(rcfile)) {
  20. @@ -194,7 +194,7 @@
  21. }
  22. - log("%s: Cannot find the control file at ~/.%s, /etc/%s or at ./%s \n",
  23. + log("%s: Cannot find the control file at ~/.%s, @l_prefix@/etc/monit/%s or at ./%s \n",
  24. prog, MONITRC, MONITRC, MONITRC);
  25. exit(1);
  26. Index: monit.1
  27. --- monit.1.orig 2003-10-27 13:31:11.000000000 +0100
  28. +++ monit.1 2003-10-27 15:24:32.000000000 +0100
  29. @@ -309,7 +309,7 @@
  30. .IX Header "HOW TO MONITOR"
  31. monit is configured and controlled via a control file called
  32. \&\fBmonitrc\fR. The default location for this file is ~/.monitrc. If
  33. -this file does not exist, monit will try /etc/monitrc and finally
  34. +this file does not exist, monit will try @l_prefix@/etc/monit/monitrc and finally
  35. \&./monitrc.
  36. .PP
  37. A monit control file consists of a series of service entries and
  38. @@ -435,7 +435,7 @@
  39. .PP
  40. .Vb 2
  41. \& # Run monit in standard run-levels
  42. -\& mo:2345:respawn:/usr/local/bin/monit -Ic /etc/monitrc
  43. +\& mo:2345:respawn:/usr/local/bin/monit -Ic @l_prefix@/etc/monit/monitrc
  44. .Ve
  45. After you have modified init's configuration file, you can run
  46. the following command to re-examine /etc/inittab and start monit:
  47. @@ -2682,7 +2682,7 @@
  48. .IX Item "4. monit starts the node group"
  49. .PD
  50. .PP
  51. -\&\fBMonit: \f(BI/etc/monitrc\fB\fR
  52. +\&\fBMonit: \f(BI@l_prefix@/etc/monit/monitrc\fB\fR
  53. .PP
  54. This example describes a cluster with 2 nodes. Services running
  55. on Node 1 are in the group \fInode1\fR and Node 2 services are in
  56. @@ -2764,7 +2764,7 @@
  57. .PP
  58. .Vb 2
  59. \& #/etc/inittab
  60. -\& mo:2345:respawn:/usr/local/bin/monit -d 10 -c /etc/monitrc -g local
  61. +\& mo:2345:respawn:/usr/local/bin/monit -d 10 -c @l_prefix@/etc/monit/monitrc -g local
  62. .Ve
  63. \&\fBheartbeat: \f(BI/etc/ha.d/haresources\fB\fR
  64. .PP
  65. @@ -2836,9 +2836,9 @@
  66. \&\fI~/.monitrc\fR
  67. Default run control file
  68. .PP
  69. -\&\fI/etc/monitrc\fR
  70. +\&\fI@l_prefix@/etc/monit/monitrc\fR
  71. If the control file is not found in the default
  72. - location and /etc contains a \fImonitrc\fR file, this
  73. + location and @l_prefix@/etc/monit contains a \fImonitrc\fR file, this
  74. file will be used instead.
  75. .PP
  76. \&\fI./monitrc\fR
  77. @@ -2851,14 +2851,10 @@
  78. Lock file to help prevent concurrent runs (non-root
  79. mode).
  80. .PP
  81. -\&\fI/var/run/monit.pid\fR
  82. +\&\fI@l_prefix@/var/monit/monit.pid\fR
  83. Lock file to help prevent concurrent runs (root mode,
  84. Linux systems).
  85. .PP
  86. -\&\fI/etc/monit.pid\fR
  87. - Lock file to help prevent concurrent runs (root mode,
  88. - systems without /var/run).
  89. -.PP
  90. \&\fI~/.monit.state\fR
  91. monit save its state to this file and utilize
  92. information found in this file to recover from