diff --git a/sysutils/monit/Makefile b/sysutils/monit/Makefile index 15c788c12d1..1a75098fb5d 100644 --- a/sysutils/monit/Makefile +++ b/sysutils/monit/Makefile @@ -1,13 +1,12 @@ -# $OpenBSD: Makefile,v 1.20 2011/06/26 10:29:11 sthen Exp $ +# $OpenBSD: Makefile,v 1.21 2012/05/29 15:45:56 jasper Exp $ COMMENT= monitoring and managing daemons utility -DISTNAME= monit-4.10.1 -REVISION= 2 +DISTNAME= monit-5.4 CATEGORIES= sysutils -HOMEPAGE= http://www.tildeslash.com/monit/ +HOMEPAGE= http://www.mmonit.com/monit/ MAINTAINER= Ben Lovett @@ -19,28 +18,17 @@ PERMIT_DISTFILES_FTP= Yes WANTLIB += c crypto kvm pthread ssl -MASTER_SITES= ${HOMEPAGE}dist/ \ - ${HOMEPAGE}dist/old/ +MASTER_SITES= ${HOMEPAGE}/dist/ CONFIGURE_STYLE=gnu -USE_GMAKE= Yes -USE_GROFF= Yes - -NO_REGRESS= Yes +USE_LIBTOOL= Yes post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/monit ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/monit - cd ${WRKSRC} && ${INSTALL_DATA} FAQ.txt README.SSL UPGRADE.txt \ - ${PREFIX}/share/doc/monit - cd ${WRKSRC}/doc && ${INSTALL_DATA} monit.html examples.html \ - ${PREFIX}/share/doc/monit - cd ${WRKSRC}/protocols && ${INSTALL_DATA} NOTES \ - ${PREFIX}/share/doc/monit + cd ${WRKSRC} && ${INSTALL_DATA} README ${PREFIX}/share/doc/monit cd ${WRKSRC} && ${INSTALL_DATA} monitrc \ ${PREFIX}/share/examples/monit - ${INSTALL_DATA} ${WRKSRC}/contrib/monit.php \ - ${PREFIX}/share/examples/monit \ .include diff --git a/sysutils/monit/distinfo b/sysutils/monit/distinfo index fac08b0bdf6..1d8b8eac4b2 100644 --- a/sysutils/monit/distinfo +++ b/sysutils/monit/distinfo @@ -1,5 +1,5 @@ -MD5 (monit-4.10.1.tar.gz) = 0xQ7C715tT8bAZ0vwdrmVg== -RMD160 (monit-4.10.1.tar.gz) = bFF7GbxD9AI9/KTeHfCScrQa8C0= -SHA1 (monit-4.10.1.tar.gz) = yHqgxuCx0T9Gt+nYSTcZHiWpB6Y= -SHA256 (monit-4.10.1.tar.gz) = 9qKTAGSDgVOKQD8kUG51uUFk4mxpxoYcoRLUJe3J0ZM= -SIZE (monit-4.10.1.tar.gz) = 606273 +MD5 (monit-5.4.tar.gz) = 8fORJB1EBZ0NPl0m9Oxd3w== +RMD160 (monit-5.4.tar.gz) = HwETmdTgSh2FJ37V7SundQouhV4= +SHA1 (monit-5.4.tar.gz) = 1Jf/YdqdMMKG4qIHlTioAuAkNsI= +SHA256 (monit-5.4.tar.gz) = gFxlRd4t1/PZ5uDGgBiyqt1fyYskPIhoF48kemCQYDg= +SIZE (monit-5.4.tar.gz) = 1197209 diff --git a/sysutils/monit/patches/patch-configure b/sysutils/monit/patches/patch-configure index c298c83de2b..bea9f00e6c8 100644 --- a/sysutils/monit/patches/patch-configure +++ b/sysutils/monit/patches/patch-configure @@ -1,29 +1,29 @@ -$OpenBSD: patch-configure,v 1.8 2007/05/28 16:14:58 rui Exp $ ---- configure.orig Mon Feb 19 22:43:14 2007 -+++ configure Mon May 28 14:44:41 2007 -@@ -3856,13 +3856,13 @@ fi +$OpenBSD: patch-configure,v 1.9 2012/05/29 15:45:56 jasper Exp $ +--- configure.orig Fri May 25 10:25:39 2012 ++++ configure Fri May 25 10:26:10 2012 +@@ -11046,13 +11046,13 @@ fi + fi - # Wacky pthread madness - pthread_libs="" --{ echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 --echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } -+{ echo "$as_me:$LINENO: checking for pthread_create in -pthread" >&5 -+echo $ECHO_N "checking for pthread_create in -pthread... $ECHO_C" >&6; } - if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +-$as_echo_n "checking for pthread_create in -lpthread... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -pthread" >&5 ++$as_echo_n "checking for pthread_create in -pthread... " >&6; } + if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" +LIBS="-pthread $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF -@@ -3918,7 +3918,7 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 - echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6; } - if test $ac_cv_lib_pthread_pthread_create = yes; then -- pthread_libs="-lpthread" -+ pthread_libs="-pthread" - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +@@ -11087,7 +11087,7 @@ if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; + #define HAVE_LIBPTHREAD 1 + _ACEOF + +- LIBS="-lpthread $LIBS" ++ LIBS="-pthread $LIBS" + + else + as_fn_error "POSIX thread library is required" "$LINENO" 5 diff --git a/sysutils/monit/patches/patch-monitrc b/sysutils/monit/patches/patch-monitrc new file mode 100644 index 00000000000..c4e98b06973 --- /dev/null +++ b/sysutils/monit/patches/patch-monitrc @@ -0,0 +1,15 @@ +$OpenBSD: patch-monitrc,v 1.1 2012/05/29 15:45:56 jasper Exp $ +--- monitrc.orig Fri May 25 10:44:37 2012 ++++ monitrc Fri May 25 10:44:58 2012 +@@ -117,8 +117,9 @@ set httpd port 2812 and + use address localhost # only accept connection from localhost + allow localhost # allow localhost to connect to the server and + allow admin:monit # require user 'admin' with password 'monit' +- allow @monit # allow users of group 'monit' to connect (rw) +- allow @users readonly # allow users of group 'users' to connect readonly ++ # Disabled due to lack of PAM. ++ #allow @monit # allow users of group 'monit' to connect (rw) ++ #allow @users readonly # allow users of group 'users' to connect readonly + + ############################################################################### + ## Services diff --git a/sysutils/monit/patches/patch-process_sysdep_OPENBSD_c b/sysutils/monit/patches/patch-process_sysdep_OPENBSD_c deleted file mode 100644 index 109ea87d8ea..00000000000 --- a/sysutils/monit/patches/patch-process_sysdep_OPENBSD_c +++ /dev/null @@ -1,59 +0,0 @@ -$OpenBSD: patch-process_sysdep_OPENBSD_c,v 1.5 2011/06/26 10:29:11 sthen Exp $ ---- process/sysdep_OPENBSD.c.orig Sun Jul 29 21:23:26 2007 -+++ process/sysdep_OPENBSD.c Sun Jun 26 11:03:00 2011 -@@ -90,6 +90,7 @@ static long cpu_syst_old = 0; - int init_process_info_sysdep(void) { - int mib[2]; - size_t len; -+ int64_t physmem; - struct clockinfo clock; - - mib[0] = CTL_KERN; -@@ -112,14 +113,14 @@ int init_process_info_sysdep(void) { - return FALSE; - } - -- mib[1] = HW_PHYSMEM; -- len = sizeof(systeminfo.mem_kbyte_max); -- if(sysctl(mib, 2, &systeminfo.mem_kbyte_max, &len, NULL, 0) == -1) -+ mib[1] = HW_PHYSMEM64; -+ len = sizeof(physmem); -+ if(sysctl(mib, 2, &physmem, &len, NULL, 0) == -1) - { - DEBUG("system statistic error -- cannot get real memory amount: %s\n", STRERROR); - return FALSE; - } -- systeminfo.mem_kbyte_max /= 1024; -+ systeminfo.mem_kbyte_max = physmem / 1024; - - mib[1] = HW_PAGESIZE; - len = sizeof(pagesize_kbyte); -@@ -157,7 +158,7 @@ int initprocesstree_sysdep(ProcessTree_T ** reference) - return FALSE; - } - -- pinfo = kvm_getprocs(kvm_handle, KERN_PROC_ALL, 0, &treesize); -+ pinfo = kvm_getprocs(kvm_handle, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &treesize); - if(!pinfo || (treesize < 1)) - { - LogError("system statistic error -- cannot get process tree\n"); -@@ -169,13 +170,13 @@ int initprocesstree_sysdep(ProcessTree_T ** reference) - - for(i = 0; i < treesize; i++) - { -- pt[i].pid = pinfo[i].kp_proc.p_pid; -- pt[i].ppid = pinfo[i].kp_eproc.e_ppid; -- pt[i].cputime = (long)((pinfo[i].kp_proc.p_rtime.tv_sec * 10) + -- (pinfo[i].kp_proc.p_rtime.tv_usec / 100000) -+ pt[i].pid = pinfo[i].p_pid; -+ pt[i].ppid = pinfo[i].p_ppid; -+ pt[i].cputime = (long)((pinfo[i].p_rtime_sec * 10) + -+ (pinfo[i].p_rtime_usec / 100000) - ); -- pt[i].mem_kbyte = (unsigned long)(pinfo[i].kp_eproc.e_vm.vm_rssize * pagesize_kbyte); -- if(pinfo[i].kp_proc.p_stat == SZOMB) -+ pt[i].mem_kbyte = (unsigned long)(pinfo[i].p_vm_rssize * pagesize_kbyte); -+ if(pinfo[i].p_stat == SZOMB) - { - pt[i].status_flag |= PROCESS_ZOMBIE; - } diff --git a/sysutils/monit/patches/patch-src_process_sysdep_OPENBSD_c b/sysutils/monit/patches/patch-src_process_sysdep_OPENBSD_c new file mode 100644 index 00000000000..cfd0716d79c --- /dev/null +++ b/sysutils/monit/patches/patch-src_process_sysdep_OPENBSD_c @@ -0,0 +1,56 @@ +$OpenBSD: patch-src_process_sysdep_OPENBSD_c,v 1.1 2012/05/29 15:45:56 jasper Exp $ + +- switch temporary kvm_getproc2 / struct kinfo_proc2 to +kvm_getprocs / struct kinfo_proc now that the old API has +been fully replaced + +--- src/process/sysdep_OPENBSD.c.orig Fri May 25 10:33:02 2012 ++++ src/process/sysdep_OPENBSD.c Fri May 25 10:35:30 2012 +@@ -140,11 +140,11 @@ int initprocesstree_sysdep(ProcessTree_T **reference) + int treesize; + char buf[_POSIX2_LINE_MAX]; + size_t size = sizeof(maxslp); +- int mib_proc2[6] = {CTL_KERN, KERN_PROC2, KERN_PROC_KTHREAD, 0, sizeof(struct kinfo_proc2), 0}; ++ int mib_proc2[6] = {CTL_KERN, KERN_PROC, KERN_PROC_KTHREAD, 0, sizeof(struct kinfo_proc), 0}; + static int mib_maxslp[] = {CTL_VM, VM_MAXSLP}; + ProcessTree_T *pt; + kvm_t *kvm_handle; +- static struct kinfo_proc2 *pinfo; ++ static struct kinfo_proc *pinfo; + + if (sysctl(mib_maxslp, 2, &maxslp, &size, NULL, 0) < 0) { + LogError("system statistic error -- vm.maxslp failed"); +@@ -152,20 +152,20 @@ int initprocesstree_sysdep(ProcessTree_T **reference) + } + + if (sysctl(mib_proc2, 6, NULL, &size, NULL, 0) == -1) { +- LogError("system statistic error -- kern.proc2 #1 failed"); ++ LogError("system statistic error -- kern.proc #1 failed"); + return FALSE; + } + + size *= 2; // Add reserve for new processes which were created between calls of sysctl + pinfo = CALLOC(1, size); +- mib_proc2[5] = (int)(size / sizeof(struct kinfo_proc2)); ++ mib_proc2[5] = (int)(size / sizeof(struct kinfo_proc)); + if (sysctl(mib_proc2, 6, pinfo, &size, NULL, 0) == -1) { + FREE(pinfo); +- LogError("system statistic error -- kern.proc2 #2 failed"); ++ LogError("system statistic error -- kern.proc #2 failed"); + return FALSE; + } + +- treesize = (int)(size / sizeof(struct kinfo_proc2)); ++ treesize = (int)(size / sizeof(struct kinfo_proc)); + + pt = CALLOC(sizeof(ProcessTree_T), treesize); + +@@ -185,7 +185,7 @@ int initprocesstree_sysdep(ProcessTree_T **reference) + pt[i].status_flag |= PROCESS_ZOMBIE; //FIXME: save system service flag too (kernel threads) + pt[i].time = get_float_time(); + char **args; +- if ((args = kvm_getargv2(kvm_handle, &pinfo[i], 0))) { ++ if ((args = kvm_getargv(kvm_handle, &pinfo[i], 0))) { + StringBuffer_T cmdline = StringBuffer_create(64);; + for (int j = 0; args[j]; j++) + StringBuffer_append(cmdline, args[j + 1] ? "%s " : "%s", args[j]); diff --git a/sysutils/monit/pkg/PLIST b/sysutils/monit/pkg/PLIST index 336b709e312..f3a35228aff 100644 --- a/sysutils/monit/pkg/PLIST +++ b/sysutils/monit/pkg/PLIST @@ -1,15 +1,9 @@ -@comment $OpenBSD: PLIST,v 1.8 2011/06/26 10:29:11 sthen Exp $ -bin/monit +@comment $OpenBSD: PLIST,v 1.9 2012/05/29 15:45:56 jasper Exp $ +@bin bin/monit @man man/man1/monit.1 share/doc/monit/ -share/doc/monit/FAQ.txt -share/doc/monit/NOTES -share/doc/monit/README.SSL -share/doc/monit/UPGRADE.txt -share/doc/monit/examples.html -share/doc/monit/monit.html +share/doc/monit/README share/examples/monit/ -share/examples/monit/monit.php share/examples/monit/monitrc @mode 0600 @sample ${SYSCONFDIR}/monitrc