diff options
| -rw-r--r-- | meta-oe/recipes-support/monit/monit/monit | 42 | ||||
| -rw-r--r-- | meta-oe/recipes-support/monit/monit/monitrc | 44 | ||||
| -rw-r--r-- | meta-oe/recipes-support/monit/monit_5.26.0.bb | 53 |
3 files changed, 139 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/monit/monit/monit b/meta-oe/recipes-support/monit/monit/monit new file mode 100644 index 0000000000..394704e061 --- /dev/null +++ b/meta-oe/recipes-support/monit/monit/monit | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | # | ||
| 3 | # This is an init script for openembedded | ||
| 4 | # Copy it to /etc/init.d/monit and type | ||
| 5 | # > update-rc.d monit defaults 89 | ||
| 6 | # | ||
| 7 | monit=/usr/bin/monit | ||
| 8 | pidfile=/var/run/monit.pid | ||
| 9 | monit_args="-c /etc/monitrc" | ||
| 10 | |||
| 11 | test -x "$monit" || exit 0 | ||
| 12 | |||
| 13 | case "$1" in | ||
| 14 | start) | ||
| 15 | echo -n "Starting Monit" | ||
| 16 | start-stop-daemon --start --quiet --exec $monit -- $monit_args | ||
| 17 | RETVAL=$? | ||
| 18 | echo "." | ||
| 19 | ;; | ||
| 20 | stop) | ||
| 21 | echo -n "Stopping Monit" | ||
| 22 | start-stop-daemon --stop --quiet --pidfile $pidfile | ||
| 23 | RETVAL=$? | ||
| 24 | echo "." | ||
| 25 | ;; | ||
| 26 | restart) | ||
| 27 | $0 stop | ||
| 28 | $0 start | ||
| 29 | RETVAL=$? | ||
| 30 | ;; | ||
| 31 | status) | ||
| 32 | $monit $monit_args status | ||
| 33 | RETVAL=$? | ||
| 34 | echo "." | ||
| 35 | ;; | ||
| 36 | *) | ||
| 37 | echo "Usage: $0 {start|stop|restart|status}" | ||
| 38 | exit 1 | ||
| 39 | esac | ||
| 40 | |||
| 41 | exit $RETVAL | ||
| 42 | |||
diff --git a/meta-oe/recipes-support/monit/monit/monitrc b/meta-oe/recipes-support/monit/monit/monitrc new file mode 100644 index 0000000000..f8d6a4388f --- /dev/null +++ b/meta-oe/recipes-support/monit/monit/monitrc | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | ############################################################################### | ||
| 2 | ## Monit control file | ||
| 3 | ############################################################################### | ||
| 4 | ## | ||
| 5 | ## Comments begin with a '#' and extend through the end of the line. Keywords | ||
| 6 | ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'. | ||
| 7 | ## | ||
| 8 | ## Below you will find examples of some frequently used statements. For | ||
| 9 | ## information about the control file and a complete list of statements and | ||
| 10 | ## options, please have a look in the Monit manual. | ||
| 11 | ## | ||
| 12 | ## | ||
| 13 | ############################################################################### | ||
| 14 | ## Global section | ||
| 15 | ############################################################################### | ||
| 16 | ## | ||
| 17 | ## Start Monit in the background (run as a daemon): | ||
| 18 | # | ||
| 19 | set daemon 30 # check services at 30 seconds intervals | ||
| 20 | # with start delay 240 # optional: delay the first check by 4-minutes (by | ||
| 21 | # # default Monit check immediately after Monit start) | ||
| 22 | # | ||
| 23 | # | ||
| 24 | ## Set syslog logging. If you want to log to a standalone log file instead, | ||
| 25 | ## specify the full path to the log file | ||
| 26 | # | ||
| 27 | set log syslog | ||
| 28 | |||
| 29 | set httpd port 2812 | ||
| 30 | allow 0.0.0.0/0 # allow localhost to connect to the server and | ||
| 31 | allow admin:monit # require user 'admin' with password 'monit' | ||
| 32 | #with ssl { # enable SSL/TLS and set path to server certificate | ||
| 33 | # pemfile: /etc/ssl/certs/monit.pem | ||
| 34 | #} | ||
| 35 | |||
| 36 | ############################################################################### | ||
| 37 | ## Includes | ||
| 38 | ############################################################################### | ||
| 39 | ## | ||
| 40 | ## It is possible to include additional configuration parts from other files or | ||
| 41 | ## directories. | ||
| 42 | # | ||
| 43 | include /etc/monit.d/* | ||
| 44 | |||
diff --git a/meta-oe/recipes-support/monit/monit_5.26.0.bb b/meta-oe/recipes-support/monit/monit_5.26.0.bb new file mode 100644 index 0000000000..a954682d6b --- /dev/null +++ b/meta-oe/recipes-support/monit/monit_5.26.0.bb | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | DESCRIPTION = "Monit is a free open source utility for managing and monitoring, \ | ||
| 2 | processes, programs, files, directories and filesystems on a UNIX system. \ | ||
| 3 | Monit conducts automatic maintenance and repair and can execute meaningful \ | ||
| 4 | causal actions in error situations." | ||
| 5 | |||
| 6 | HOMEPAGE = "http://mmonit.com/monit/" | ||
| 7 | |||
| 8 | LICENSE = "AGPL-3.0" | ||
| 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea116a7defaf0e93b3bb73b2a34a3f51 \ | ||
| 10 | file://libmonit/COPYING;md5=2405f1c59ed1bf3714cebdb40162ce92" | ||
| 11 | |||
| 12 | SRC_URI = " \ | ||
| 13 | https://mmonit.com/monit/dist/monit-${PV}.tar.gz \ | ||
| 14 | file://monit \ | ||
| 15 | file://monitrc \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI[md5sum] = "9f7dc65e902c103e4c5891354994c3df" | ||
| 19 | SRC_URI[sha256sum] = "87fc4568a3af9a2be89040efb169e3a2e47b262f99e78d5ddde99dd89f02f3c2" | ||
| 20 | |||
| 21 | DEPENDS = "zlib bison-native libnsl2 flex-native openssl virtual/crypt" | ||
| 22 | |||
| 23 | inherit autotools-brokensep systemd update-rc.d | ||
| 24 | |||
| 25 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" | ||
| 26 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" | ||
| 27 | |||
| 28 | EXTRA_OECONF = "\ | ||
| 29 | libmonit_cv_setjmp_available=no \ | ||
| 30 | libmonit_cv_vsnprintf_c99_conformant=no \ | ||
| 31 | --with-ssl-lib-dir=${STAGING_LIBDIR} \ | ||
| 32 | --with-ssl-incl-dir=${STAGING_INCDIR} \ | ||
| 33 | " | ||
| 34 | |||
| 35 | SYSTEMD_SERVICE_${PN} = "monit.service" | ||
| 36 | SYSTEMD_AUTO_ENABLE = "enable" | ||
| 37 | |||
| 38 | INITSCRIPT_PACKAGES = "${PN}" | ||
| 39 | INITSCRIPT_NAME_${PN} = "monit" | ||
| 40 | INITSCRIPT_PARAMS_${PN} = "defaults 89" | ||
| 41 | |||
| 42 | do_install_append() { | ||
| 43 | |||
| 44 | # Configuration file | ||
| 45 | install -Dm 0600 ${WORKDIR}/monitrc ${D}${sysconfdir}/monitrc | ||
| 46 | |||
| 47 | # SystemD | ||
| 48 | install -Dm 0644 ${S}/system/startup/monit.service.in ${D}${systemd_system_unitdir}/monit.service | ||
| 49 | sed -i -e 's,@prefix@,${exec_prefix},g' ${D}${systemd_unitdir}/system/monit.service | ||
| 50 | |||
| 51 | # SysV | ||
| 52 | install -Dm 0755 ${WORKDIR}/monit ${D}${sysconfdir}/init.d/monit | ||
| 53 | } | ||
