Hello community, here is the log from the commit of package monit for openSUSE:Factory checked in at 2012-03-12 20:15:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/monit (Old) and /work/SRC/openSUSE:Factory/.monit.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "monit", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/monit/monit.changes 2011-12-01 12:24:49.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.monit.new/monit.changes 2012-03-12 20:15:48.000000000 +0100 @@ -1,0 +2,42 @@ +Tue Mar 6 09:13:45 UTC 2012 - [email protected] + +- license update: AGPL-3.0 + My mistake - there is no entry for AGPL-3.0+ on spdx.org/licenses. The + only available one is AGPL-3.0 (without the plus) + +------------------------------------------------------------------- +Wed Feb 29 14:17:55 UTC 2012 - [email protected] + +- license update: AGPL-3.0+ + monit is AGPL-3.0 _not_ GPL-3.0 + +------------------------------------------------------------------- +Wed Jan 25 23:34:26 UTC 2012 - [email protected] + +- fix bnc#743289 by adding monit-dirs.patch to set the PIDDIR accordingly to + what is preset in the monitrc configuration (and in the spec file), as well + as to fix the default event directory + +------------------------------------------------------------------- +Wed Dec 21 08:26:20 UTC 2011 - [email protected] + +- update to 5.3.2: + * fix bug #34801: the file content match test did reset of the read position + in the case that the unmonitor or stop action was done. When the file + monitoring was enabled again, the content match test was applied to the + content which was tested already. + * log error details in the case that the name resolving failed + * fix the system cpu usage statistics when pattern based process check is + used and the service is restarted + * Debian Bug#652715: "include files not found" warning: do not display the + warning if the include directory is empty + +- create /var/run/monit in the init script on start (if needed), as /var/run is + on a volatile filesystem (tmpfs) since 12.1 + +------------------------------------------------------------------- +Tue Dec 13 13:21:51 UTC 2011 - [email protected] + +- fix license to be in spdx.org format + +------------------------------------------------------------------- Old: ---- monit-5.3.1.tar.gz New: ---- monit-5.3.2.tar.gz monit-dirs.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ monit.spec ++++++ --- /var/tmp/diff_new_pack.3O47in/_old 2012-03-12 20:15:50.000000000 +0100 +++ /var/tmp/diff_new_pack.3O47in/_new 2012-03-12 20:15:50.000000000 +0100 @@ -1,7 +1,8 @@ # # spec file for package monit # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Pascal Bleser <[email protected]> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,24 +16,31 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild Name: monit -Version: 5.3.1 -Release: 1 +Version: 5.3.2 +Release: 0 Summary: Service Manager and Monitor System +License: AGPL-3.0 +Group: System/Monitoring Source: http://mmonit.com/monit/dist/monit-%{version}.tar.gz Source1: monit-vendor-files.tar.gz Patch1: monit-page_shift.patch Patch2: monit-better_default_monitrc.patch +Patch3: monit-dirs.patch Source99: monit-rpmlintrc Url: http://mmonit.com/monit/download/ -Group: System/Monitoring -License: GNU General Public License (GPL) BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: bison flex gcc glibc-devel make openssl-devel -BuildRequires: autoconf automake libtool +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: bison +BuildRequires: flex +BuildRequires: gcc +BuildRequires: glibc-devel +BuildRequires: libtool +BuildRequires: make +BuildRequires: openssl-devel Obsoletes: monit-beta < %{version} Provides: monit-beta = %{version} %if "%{_vendor}" == "suse" @@ -53,7 +61,6 @@ remote hosts: monit can ping a remote host and check port connections. %package doc -License: GNU General Public License (GPL) Summary: Service Manager and Monitor System (Documentation and Examples) Group: System/Monitoring %if 0%{?suse_version} >= 1120 @@ -78,6 +85,14 @@ %setup -q -a1 %patch1 %patch2 +%patch3 +%__perl -n -e 'print $1,"\n" if /^\+{3}\s+(\S+)/' <"%PATCH3" \ +| while read f; do + %__perl -i -p -e ' +s,\Q@@PIDDIR@@\E,%{_var}/run/monit,g; +s,\Q@@EVENTDIR@@\E,%{_var}/run/monit/events,g; +' "$f" +done find doc/ -type f -size 0 -exec %__rm {} \; ++++++ monit-5.3.1.tar.gz -> monit-5.3.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/CHANGES new/monit-5.3.2/CHANGES --- old/monit-5.3.1/CHANGES 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/CHANGES 2011-12-20 21:40:30.000000000 +0100 @@ -1,4 +1,4 @@ - CHANGES version 5.3.1 + CHANGES version 5.3.2 This file summarizes changes made since 5.0 @@ -7,6 +7,29 @@ https://savannah.nongnu.org/bugs/?group=monit +Version 5.3.2 + +BUGFIXES: + +* Fix bug #34801: The file content match test did reset of the + read position in the case that the unmonitor or stop action + was done. When the file monitoring was enabled again, the + content match test was applied to the content which was + tested already. + +* Log error details in the case that the name resolving failed. + +* Fix the system cpu usage statistics when pattern based process + check is used and the service is restarted. Thanks to Wayne + Lawrence for report. + +* AIX 6.1 compile fix. Thanks to Benedikt Wegmann for patch. + +* Debian Bug#652715: "include files not found" warning. Do not + display the warning if the include directory is empty. + + + Version 5.3.1 IMPROVEMENTS: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/Makefile.am new/monit-5.3.2/Makefile.am --- old/monit-5.3.1/Makefile.am 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/Makefile.am 2011-12-20 21:40:30.000000000 +0100 @@ -18,7 +18,7 @@ AM_CPPFLAGS = $(CPPFLAGS) $(EXTCPPFLAGS) -D@ARCH@ -DSYSCONFDIR="\"@sysconfdir@\"" AM_LDFLAGS = $(LDFLAGS) $(EXTLDFLAGS) -L./lib/ INCLUDES = -I./src -I./src/device -I./src/http -I./src/process -I./src/protocols -INCLUDES += -I./libmonit/src -I./libmonit/src/io +INCLUDES += -I./libmonit/src bin_PROGRAMS = monit monit_SOURCES = src/y.tab.c \ @@ -106,6 +106,7 @@ -rm -rf `find $(distdir) -name ".DS_Store"` -rm -rf `find $(distdir) -name ".libs"` -rm -rf `find $(distdir) -name ".svn"` + -rm -rf `find $(distdir) -name ".dirstamp"` -rm -rf $(distdir)/libmonit/libmonit.xcodeproj -rm -rf $(distdir)/libmonit/config.log -rm -rf $(distdir)/libmonit/config.status diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/Makefile.in new/monit-5.3.2/Makefile.in --- old/monit-5.3.1/Makefile.in 2011-10-25 01:02:01.000000000 +0200 +++ new/monit-5.3.2/Makefile.in 2011-12-20 21:40:43.000000000 +0100 @@ -310,7 +310,7 @@ AM_CPPFLAGS = $(CPPFLAGS) $(EXTCPPFLAGS) -D@ARCH@ -DSYSCONFDIR="\"@sysconfdir@\"" AM_LDFLAGS = $(LDFLAGS) $(EXTLDFLAGS) -L./lib/ INCLUDES = -I./src -I./src/device -I./src/http -I./src/process \ - -I./src/protocols -I./libmonit/src -I./libmonit/src/io + -I./src/protocols -I./libmonit/src monit_SOURCES = src/y.tab.c \ src/lex.yy.c \ src/monit.c \ @@ -1167,6 +1167,7 @@ -rm -rf `find $(distdir) -name ".DS_Store"` -rm -rf `find $(distdir) -name ".libs"` -rm -rf `find $(distdir) -name ".svn"` + -rm -rf `find $(distdir) -name ".dirstamp"` -rm -rf $(distdir)/libmonit/libmonit.xcodeproj -rm -rf $(distdir)/libmonit/config.log -rm -rf $(distdir)/libmonit/config.status diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/configure new/monit-5.3.2/configure --- old/monit-5.3.1/configure 2011-10-25 01:02:02.000000000 +0200 +++ new/monit-5.3.2/configure 2011-12-20 21:40:44.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for monit 5.3.1. +# Generated by GNU Autoconf 2.65 for monit 5.3.2. # # Report bugs to <[email protected]>. # @@ -701,8 +701,8 @@ # Identity of this package. PACKAGE_NAME='monit' PACKAGE_TARNAME='monit' -PACKAGE_VERSION='5.3.1' -PACKAGE_STRING='monit 5.3.1' +PACKAGE_VERSION='5.3.2' +PACKAGE_STRING='monit 5.3.2' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='' @@ -1431,7 +1431,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures monit 5.3.1 to adapt to many kinds of systems. +\`configure' configures monit 5.3.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1501,7 +1501,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of monit 5.3.1:";; + short | recursive ) echo "Configuration of monit 5.3.2:";; esac cat <<\_ACEOF @@ -1609,7 +1609,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -monit configure 5.3.1 +monit configure 5.3.2 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2091,7 +2091,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by monit $as_me 5.3.1, which was +It was created by monit $as_me 5.3.2, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2900,7 +2900,7 @@ # Define the identity of the package. PACKAGE='monit' - VERSION='5.3.1' + VERSION='5.3.2' cat >>confdefs.h <<_ACEOF @@ -11348,7 +11348,7 @@ kvm.h \ paths.h \ kstat.h \ - libperfstat.h \ + sys/protosw.h \ limits.h \ loadavg.h \ locale.h \ @@ -11425,6 +11425,28 @@ for ac_header in \ + libperfstat.h \ + +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " + #ifdef HAVE_SYS_PROTOSW_H + #include <sys/protosw.h> + #endif + +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in \ netinet/ip.h \ do : @@ -13347,7 +13369,7 @@ else if test -z "$sslincldir"; then - for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt /usr/sfw /opt/csw; do + for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt /usr/sfw /opt/csw /opt/freeware; do for dir in "$maindir/include"\ "$maindir/include/openssl"\ "$maindir/include/ssl"\ @@ -13391,7 +13413,8 @@ /var \ /opt \ /usr/sfw \ - /opt/csw; do + /opt/csw \ + /opt/freeware; do for dir in $maindir \ $maindir/openssl \ $maindir/ssl \ @@ -13985,7 +14008,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by monit $as_me 5.3.1, which was +This file was extended by monit $as_me 5.3.2, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14051,7 +14074,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -monit config.status 5.3.1 +monit config.status 5.3.2 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/configure.ac new/monit-5.3.2/configure.ac --- old/monit-5.3.1/configure.ac 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/configure.ac 2011-12-20 21:40:30.000000000 +0100 @@ -6,7 +6,7 @@ # Note: in case of beta subversion, use underscore "_" rather then dash "-" # since RPM doesn't allow dash in Version # Example: 5.0_beta2 -AC_INIT([monit], [5.3.1], [[email protected]]) +AC_INIT([monit], [5.3.2], [[email protected]]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE @@ -121,7 +121,7 @@ kvm.h \ paths.h \ kstat.h \ - libperfstat.h \ + sys/protosw.h \ limits.h \ loadavg.h \ locale.h \ @@ -185,6 +185,17 @@ ]) AC_CHECK_HEADERS([ \ + libperfstat.h \ + ], + [], + [], + [ + #ifdef HAVE_SYS_PROTOSW_H + #include <sys/protosw.h> + #endif + ]) + +AC_CHECK_HEADERS([ \ netinet/ip.h \ ], [], @@ -708,7 +719,7 @@ [ if test -z "$sslincldir"; then dnl Search default locations of SSL includes - for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt /usr/sfw /opt/csw; do + for maindir in /usr /usr/local /usr/lib /usr/pkg /var /opt /usr/sfw /opt/csw /opt/freeware; do for dir in "$maindir/include"\ "$maindir/include/openssl"\ "$maindir/include/ssl"\ @@ -747,7 +758,8 @@ /var \ /opt \ /usr/sfw \ - /opt/csw; do + /opt/csw \ + /opt/freeware; do for dir in $maindir \ $maindir/openssl \ $maindir/ssl \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/contrib/packages/redhat/monit.spec new/monit-5.3.2/contrib/packages/redhat/monit.spec --- old/monit-5.3.1/contrib/packages/redhat/monit.spec 2011-10-25 01:02:28.000000000 +0200 +++ new/monit-5.3.2/contrib/packages/redhat/monit.spec 2011-12-20 21:41:18.000000000 +0100 @@ -1,6 +1,6 @@ Name: monit Summary: Process monitor and restart utility -Version: 5.3.1 +Version: 5.3.2 Release: 1 Source: http://www.mmonit.com/monit/dist/%{name}-%{version}.tar.gz Group: Utilities/Console diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/doc/monit.pod new/monit-5.3.2/doc/monit.pod --- old/monit-5.3.1/doc/monit.pod 2011-10-25 01:01:50.000000000 +0200 +++ new/monit-5.3.2/doc/monit.pod 2011-12-20 21:40:30.000000000 +0100 @@ -664,6 +664,7 @@ permission pid ppid + resource size status timeout @@ -1025,10 +1026,10 @@ =head1 SERVICE TESTS -Monit provides several tests you can use in a service entry to -test a service. There are two classes of tests: variable and -constant tests. That is, the condition we test is either constant -e.g. a number or it can vary. +Monit provides several tests you can use in a 'check service' +entry to test a service. There are two classes of tests: +variable and constant tests. That is, the condition we test +is either constant e.g. a number or it can vary. A constant test has this general format: @@ -1439,9 +1440,9 @@ =head2 FILE SIZE TESTING -The size statement may only be used in a file service entry. If -specified in the control file, Monit will compute a size for a -file. +The size statement may only be used in a check file service +entry. If specified in the control file, Monit will compute +a size for a file. The size test in constant form is used to verify various size conditions. Syntax (keywords are in capital): @@ -1634,9 +1635,9 @@ =head2 SPACE TESTING -Monit can test file systems for space usage. This test may only -be used within a filesystem service entry in the Monit control -file. +Monit can test file systems for space usage. This test may +only be used within a check filesystem service entry in the +Monit control file. Monit will check a filesystem's total space usage. If you only want to check available space for non-superuser, you must set the @@ -1673,9 +1674,9 @@ =head2 INODE TESTING -If supported by the file-system, you can use Monit to test for -inodes usage. This test may only be used within a filesystem -service entry in the Monit control file. +If supported by the file-system, you can use Monit to test +for inodes usage. This test may only be used within a check +filesystem service entry in the Monit control file. If the filesystem becomes unavailable, Monit will call the service's registered start method, if it is defined and if Monit @@ -1749,9 +1750,10 @@ =head2 UID TESTING -Monit can monitor the owner user id (uid) of a file object. This -test may only be used within a file, fifo, directory or -filesystem service entry in the Monit control file. +Monit can monitor the owner user id (uid) of a file object. +This test may only be used within a check - file, fifo, +directory or filesystem service entry in the Monit control +file. The syntax for the uid statement is: @@ -1891,9 +1893,10 @@ =head2 CONNECTION TESTING -Monit is able to perform connection testing via networked ports -or via Unix sockets. A connection test may only be used within a -process or within a host service entry in the Monit control file. +Monit is able to perform connection testing via networked +ports or via Unix sockets. A connection test may only be +used within a check process or within a check host service +entry in the Monit control file. If a service listens on one or more sockets, Monit can connect to the port (using either tcp or udp) and verify that the service @@ -2500,7 +2503,7 @@ =head2 PROGRAM STATUS TESTING You can check the exit status of a program or a script. This test -may only be used within a program service entry in the Monit +may only be used within a check program service entry in the Monit control file. An example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/io/File.c new/monit-5.3.2/libmonit/src/io/File.c --- old/monit-5.3.1/libmonit/src/io/File.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/io/File.c 2011-12-20 21:40:30.000000000 +0100 @@ -109,6 +109,11 @@ } +int File_rewind(int fd) { + return (lseek(fd, 0, SEEK_SET) >=0); +} + + time_t File_mtime(const char *file) { if (file) { struct stat buf; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/io/File.h new/monit-5.3.2/libmonit/src/io/File.h --- old/monit-5.3.1/libmonit/src/io/File.h 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/io/File.h 2011-12-20 21:40:30.000000000 +0100 @@ -104,6 +104,15 @@ /** + * Move the <code>read</code> position in the file to the beginning + * of input. + * @param fd An open file descriptor + * @return true if success otherwise false and errno is set accordingly + */ +int File_rewind(int fd); + + +/** * Returns the last modified time stamp for the given <code>file</code>. * A file's mtime is changed by a file write operation * @param file An absolute file path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/io/InputStream.c new/monit-5.3.2/libmonit/src/io/InputStream.c --- old/monit-5.3.1/libmonit/src/io/InputStream.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/io/InputStream.c 2011-12-20 21:40:30.000000000 +0100 @@ -75,10 +75,12 @@ static inline int fill(T S) { if (S->isclosed) return -1; + S->length = 0; + S->offset = 0; errno = 0; - int n = (int)Net_read(S->fd, S->buffer + S->length, BUFFER_SIZE - S->length, S->timeout); + int n = (int)Net_read(S->fd, S->buffer, BUFFER_SIZE, S->timeout); if (n > 0) - S->length += n; + S->length = n; else if (n < 0) { n = -1; S->isclosed = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/io/OutputStream.c new/monit-5.3.2/libmonit/src/io/OutputStream.c --- old/monit-5.3.1/libmonit/src/io/OutputStream.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/io/OutputStream.c 2011-12-20 21:40:30.000000000 +0100 @@ -113,28 +113,28 @@ #define pad(n,c) do { int nn = (n); while (nn-- > 0) write_byte(S, (c)); } while (0) static void putd(T S, const char *str, int len, unsigned char flags[], int width, int precision) { - int sign; - assert(str); - assert(len >= 0); - assert(flags); - if (width == INT_MIN) - width = 0; - if (width < 0) { - flags['-'] = 1; - width = -width; - } - if (precision >= 0) - flags['0'] = 0; - if (len > 0 && (*str == '-' || *str == '+')) { - sign = *str++; - len--; - } else if (flags['+']) - sign = '+'; - else if (flags[' ']) - sign = ' '; - else - sign = 0; - { int n; + int sign; + assert(str); + assert(len >= 0); + assert(flags); + if (width == INT_MIN) + width = 0; + if (width < 0) { + flags['-'] = 1; + width = -width; + } + if (precision >= 0) + flags['0'] = 0; + if (len > 0 && (*str == '-' || *str == '+')) { + sign = *str++; + len--; + } else if (flags['+']) + sign = '+'; + else if (flags[' ']) + sign = ' '; + else + sign = 0; + { int n; if (precision < 0) precision = 1; if (len < precision) @@ -167,145 +167,145 @@ static void cvt_s(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - uchar_t *str = va_arg(box->ap, uchar_t *); + uchar_t *str = va_arg(box->ap, uchar_t *); assert(str); int len = (int)strlen((char*)str); - assert(len >= 0); - assert(flags); - if (width == INT_MIN) - width = 0; - if (width < 0) { - flags['-'] = 1; - width = -width; - } - if (precision >= 0) - flags['0'] = 0; - if (precision >= 0 && precision < len) - len = precision; - if (!flags['-']) - pad(width - len, ' '); + assert(len >= 0); + assert(flags); + if (width == INT_MIN) + width = 0; + if (width < 0) { + flags['-'] = 1; + width = -width; + } + if (precision >= 0) + flags['0'] = 0; + if (precision >= 0 && precision < len) + len = precision; + if (!flags['-']) + pad(width - len, ' '); for (int i = 0; i < len; i++) write_byte(S, *str++); - if (flags['-']) - pad(width - len, ' '); + if (flags['-']) + pad(width - len, ' '); } static void cvt_d(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - int val = va_arg(box->ap, int); - unsigned int m; - char buf[43]; - char *p = buf + sizeof buf; - if (val == INT_MIN) - m = INT_MAX + 1UL; - else if (val < 0) - m = -val; - else - m = val; - do - *--p = m%10 + '0'; - while ((m /= 10) > 0); - if (val < 0) - *--p = '-'; - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + int val = va_arg(box->ap, int); + unsigned int m; + char buf[43]; + char *p = buf + sizeof buf; + if (val == INT_MIN) + m = INT_MAX + 1UL; + else if (val < 0) + m = -val; + else + m = val; + do + *--p = m%10 + '0'; + while ((m /= 10) > 0); + if (val < 0) + *--p = '-'; + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_l(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - long val = va_arg(box->ap, long); - unsigned long m; - char buf[43]; - char *p = buf + sizeof buf; - if (val == LONG_MIN) - m = LONG_MAX + 1UL; - else if (val < 0) - m = -val; - else - m = val; - do - *--p = m%10 + '0'; - while ((m /= 10) > 0); - if (val < 0) - *--p = '-'; - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + long val = va_arg(box->ap, long); + unsigned long m; + char buf[43]; + char *p = buf + sizeof buf; + if (val == LONG_MIN) + m = LONG_MAX + 1UL; + else if (val < 0) + m = -val; + else + m = val; + do + *--p = m%10 + '0'; + while ((m /= 10) > 0); + if (val < 0) + *--p = '-'; + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_u(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - unsigned long m = va_arg(box->ap, unsigned long); - char buf[43]; - char *p = buf + sizeof buf; - do - *--p = m%10 + '0'; - while ((m /= 10) > 0); - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + unsigned long m = va_arg(box->ap, unsigned long); + char buf[43]; + char *p = buf + sizeof buf; + do + *--p = m%10 + '0'; + while ((m /= 10) > 0); + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_o(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - unsigned long m = va_arg(box->ap, unsigned long); - char buf[43]; - char *p = buf + sizeof buf; - do - *--p = (m&0x7) + '0'; - while ((m>>= 3) != 0); - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + unsigned long m = va_arg(box->ap, unsigned long); + char buf[43]; + char *p = buf + sizeof buf; + do + *--p = (m&0x7) + '0'; + while ((m>>= 3) != 0); + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_x(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - unsigned long m = va_arg(box->ap, unsigned long); - char buf[43]; - char *p = buf + sizeof buf; - do - *--p = "0123456789abcdef"[m&0xf]; - while ((m>>= 4) != 0); - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + unsigned long m = va_arg(box->ap, unsigned long); + char buf[43]; + char *p = buf + sizeof buf; + do + *--p = "0123456789abcdef"[m&0xf]; + while ((m>>= 4) != 0); + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_p(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - unsigned long m = (unsigned long)va_arg(box->ap, void*); - char buf[43]; - char *p = buf + sizeof buf; - precision = INT_MIN; - do - *--p = "0123456789abcdef"[m&0xf]; - while ((m>>= 4) != 0); - putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); + unsigned long m = (unsigned long)va_arg(box->ap, void*); + char buf[43]; + char *p = buf + sizeof buf; + precision = INT_MIN; + do + *--p = "0123456789abcdef"[m&0xf]; + while ((m>>= 4) != 0); + putd(S, p, (int)((buf + sizeof buf) - p), flags, width, precision); } static void cvt_c(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - if (width == INT_MIN) - width = 0; - if (width < 0) { - flags['-'] = 1; - width = -width; - } - if (!flags['-']) - pad(width - 1, ' '); - write_byte(S, va_arg(box->ap, int)); - if (flags['-']) - pad(width - 1, ' '); + if (width == INT_MIN) + width = 0; + if (width < 0) { + flags['-'] = 1; + width = -width; + } + if (!flags['-']) + pad(width - 1, ' '); + write_byte(S, va_arg(box->ap, int)); + if (flags['-']) + pad(width - 1, ' '); } static void cvt_f(T S, int code, va_list_box *box, unsigned char flags[], int width, int precision) { - char buf[DBL_MAX_10_EXP+1+1+99+1]; - if (precision < 0) - precision = 6; - if (code == 'g' && precision == 0) - precision = 1; - { - char fmt[] = "%.dd?"; - assert(precision <= 99); - fmt[4] = code; - fmt[3] = precision%10 + '0'; - fmt[2] = (precision/10)%10 + '0'; - sprintf(buf, fmt, va_arg(box->ap, double)); - } - putd(S, buf, (int)strlen(buf), flags, width, precision); + char buf[DBL_MAX_10_EXP+1+1+99+1]; + if (precision < 0) + precision = 6; + if (code == 'g' && precision == 0) + precision = 1; + { + char fmt[] = "%.dd?"; + assert(precision <= 99); + fmt[4] = code; + fmt[3] = precision%10 + '0'; + fmt[2] = (precision/10)%10 + '0'; + sprintf(buf, fmt, va_arg(box->ap, double)); + } + putd(S, buf, (int)strlen(buf), flags, width, precision); } @@ -412,8 +412,8 @@ va_copy(box.ap, ap); S->sessionWritten = 0; while (*fmt) { - if (*fmt != '%' || *++fmt == '%') - write_byte(S, *fmt++); + if (*fmt != '%' || *++fmt == '%') + write_byte(S, *fmt++); else { uchar_t c, flags[256] = {0}; int width = INT_MIN, precision = INT_MIN; @@ -456,7 +456,7 @@ c = 'l'; } assert(cvt[c]); - (*cvt[c])(S, c, &box, flags, width, precision); + cvt[c](S, c, &box, flags, width, precision); } } va_end(box.ap); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/system/Time.c new/monit-5.3.2/libmonit/src/system/Time.c --- old/monit-5.3.1/libmonit/src/system/Time.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/system/Time.c 2011-12-20 21:40:30.000000000 +0100 @@ -420,7 +420,7 @@ } -time_t Time_now() { +time_t Time_now(void) { struct timeval t; if (gettimeofday(&t, NULL) != 0) THROW(AssertException, "%s", System_getLastError()); @@ -428,7 +428,7 @@ } -long long int Time_milli() { +long long int Time_milli(void) { struct timeval t; if (gettimeofday(&t, NULL) != 0) THROW(AssertException, "%s", System_getLastError()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/thread/Thread.h new/monit-5.3.2/libmonit/src/thread/Thread.h --- old/monit-5.3.1/libmonit/src/thread/Thread.h 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/thread/Thread.h 2011-12-20 21:40:30.000000000 +0100 @@ -25,6 +25,13 @@ #ifndef THREAD_INCLUDED #define THREAD_INCLUDED +#include <stdio.h> +#include <errno.h> +#include <assert.h> +#include <string.h> +#include <pthread.h> +#include "system/System.h" + /** * General purpose <b>Thread</b> abstractions. This interface defines object @@ -35,16 +42,10 @@ */ -/* -------------------------------------------- Thread interface for POSIX */ -#include <stdio.h> -#include <errno.h> -#include <assert.h> -#include <string.h> -#include <pthread.h> /** @cond hidden */ #define wrapper(F) do { \ int status= F; if (! (status == 0 || status==ETIMEDOUT)) \ - Exception_throw(&AssertException, __func__, __FILE__, __LINE__, "%s -- %s", #F, strerror(status)); \ + THROW(AssertException, "%s -- %s", #F, System_getError(status)); \ } while (0) /** @endcond */ /** @name Abstract Data Types */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/src/util/Str.c new/monit-5.3.2/libmonit/src/util/Str.c --- old/monit-5.3.1/libmonit/src/util/Str.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/src/util/Str.c 2011-12-20 21:40:30.000000000 +0100 @@ -203,11 +203,11 @@ int Str_startsWith(const char *a, const char *b) { - if (a && b) { - const char *s = a; - while (*a && *b) - if (toupper(*a++) != toupper(*b++)) return false; - return ((*a == *b) || (a != s && *b == 0)); + if (a && b) { + do + if (*a++ != *b++) return false; + while (*b); + return true; } return false; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/test/CommandTest.c new/monit-5.3.2/libmonit/test/CommandTest.c --- old/monit-5.3.1/libmonit/test/CommandTest.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/test/CommandTest.c 2011-12-20 21:40:30.000000000 +0100 @@ -22,7 +22,7 @@ static void onExec(Process_T P) { assert(P); - char buf[STRLEN + 1]; + char buf[STRLEN]; // Child process info printf("\tSubprocess ((pid=%d) created with cwd (%s)\n", Process_getPid(P), Process_getDir(P)); InputStream_T in = Process_getInputStream(P); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/libmonit/test/InputStreamTest.c new/monit-5.3.2/libmonit/test/InputStreamTest.c --- old/monit-5.3.1/libmonit/test/InputStreamTest.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/libmonit/test/InputStreamTest.c 2011-12-20 21:40:30.000000000 +0100 @@ -11,6 +11,7 @@ #include "InputStream.h" #include "File.h" #include "Str.h" +#include "system/System.h" /** * InputStream.c unit tests. @@ -97,18 +98,41 @@ } printf("=> Test4: OK\n\n"); - printf("=> Test5: wrong descriptor - expecting read fail\n"); + printf("=> Test5: read a large file\n"); + { + if ((fd = File_open("/usr/share/dict/words", "r")) >= 0) { + int n = 0; + char array[2][STRLEN + 1]; + in = InputStream_new(fd); + for (int i = 0; ((n = InputStream_readBytes(in, array[i], STRLEN)) > 0); i = i ? 0 : 1) + assert(strncmp(array[0], array[1], STRLEN/2) != 0); // ensure that InputStream buffer is filled anew + File_rewind(fd); + // Test read data larger than InputStream's internal buffer + int filesize = (int)File_size("/usr/share/dict/words"); + char *bigarray = CALLOC(1, filesize + 1); + n = InputStream_readBytes(in, bigarray, filesize); + assert(n == filesize); + File_close(fd); + InputStream_free(&in); + FREE(bigarray); + } else + ERROR("\t/usr/share/dict/words not available -- skipping test\n"); + } + printf("=> Test5: OK\n\n"); + + printf("=> Test6: wrong descriptor - expecting read fail\n"); { in = InputStream_new(999); TRY - assert(InputStream_read(in) != -1); - assert(false); // Should not come here + assert(InputStream_read(in) != -1); + assert(false); // Should not come here CATCH(AssertException) - // Passed + // Passed END_TRY; InputStream_free(&in); } - printf("=> Test5: OK\n\n"); + printf("=> Test6: OK\n\n"); + printf("============> InputStream Tests: OK\n\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/monit.1 new/monit-5.3.2/monit.1 --- old/monit-5.3.1/monit.1 2011-10-25 01:02:28.000000000 +0200 +++ new/monit-5.3.2/monit.1 2011-12-20 21:41:18.000000000 +0100 @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "MONIT 1" -.TH MONIT 1 "www.mmonit.com" "October 25. 2011" "User Commands" +.TH MONIT 1 "www.mmonit.com" "December 20. 2011" "User Commands" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -771,6 +771,7 @@ \& permission \& pid \& ppid +\& resource \& size \& status \& timeout @@ -1151,10 +1152,10 @@ .Ve .SH "SERVICE TESTS" .IX Header "SERVICE TESTS" -Monit provides several tests you can use in a service entry to -test a service. There are two classes of tests: variable and -constant tests. That is, the condition we test is either constant -e.g. a number or it can vary. +Monit provides several tests you can use in a 'check service' +entry to test a service. There are two classes of tests: +variable and constant tests. That is, the condition we test +is either constant e.g. a number or it can vary. .PP A constant test has this general format: .IP "\s-1IF\s0 <\s-1TEST\s0> [[<X>] [\s-1TIMES\s0 \s-1WITHIN\s0] <Y> \s-1CYCLES\s0] \s-1THEN\s0 \s-1ACTION\s0 [\s-1ELSE\s0 \s-1IF\s0 \s-1SUCCEEDED\s0 [[<X>] [\s-1TIMES\s0 \s-1WITHIN\s0] <Y> \s-1CYCLES\s0] \s-1THEN\s0 \s-1ACTION\s0]" 4 @@ -1515,9 +1516,9 @@ .Ve .SS "\s-1FILE\s0 \s-1SIZE\s0 \s-1TESTING\s0" .IX Subsection "FILE SIZE TESTING" -The size statement may only be used in a file service entry. If -specified in the control file, Monit will compute a size for a -file. +The size statement may only be used in a check file service +entry. If specified in the control file, Monit will compute +a size for a file. .PP The size test in constant form is used to verify various size conditions. Syntax (keywords are in capital): @@ -1694,9 +1695,9 @@ .Ve .SS "\s-1SPACE\s0 \s-1TESTING\s0" .IX Subsection "SPACE TESTING" -Monit can test file systems for space usage. This test may only -be used within a filesystem service entry in the Monit control -file. +Monit can test file systems for space usage. This test may +only be used within a check filesystem service entry in the +Monit control file. .PP Monit will check a filesystem's total space usage. If you only want to check available space for non-superuser, you must set the @@ -1726,9 +1727,9 @@ \&\*(L"\s-1EXEC\s0\*(R" or \*(L"\s-1UNMONITOR\s0\*(R". .SS "\s-1INODE\s0 \s-1TESTING\s0" .IX Subsection "INODE TESTING" -If supported by the file-system, you can use Monit to test for -inodes usage. This test may only be used within a filesystem -service entry in the Monit control file. +If supported by the file-system, you can use Monit to test +for inodes usage. This test may only be used within a check +filesystem service entry in the Monit control file. .PP If the filesystem becomes unavailable, Monit will call the service's registered start method, if it is defined and if Monit @@ -1787,9 +1788,10 @@ a depend tree. .SS "\s-1UID\s0 \s-1TESTING\s0" .IX Subsection "UID TESTING" -Monit can monitor the owner user id (uid) of a file object. This -test may only be used within a file, fifo, directory or -filesystem service entry in the Monit control file. +Monit can monitor the owner user id (uid) of a file object. +This test may only be used within a check \- file, fifo, +directory or filesystem service entry in the Monit control +file. .PP The syntax for the uid statement is: .IP "\s-1IF\s0 \s-1FAILED\s0 \s-1UID\s0 user [[<X>] <Y> \s-1CYCLES\s0] \s-1THEN\s0 action [\s-1ELSE\s0 \s-1IF\s0 \s-1SUCCEEDED\s0 [[<X>] <Y> \s-1CYCLES\s0] \s-1THEN\s0 action]" 4 @@ -1905,9 +1907,10 @@ .Ve .SS "\s-1CONNECTION\s0 \s-1TESTING\s0" .IX Subsection "CONNECTION TESTING" -Monit is able to perform connection testing via networked ports -or via Unix sockets. A connection test may only be used within a -process or within a host service entry in the Monit control file. +Monit is able to perform connection testing via networked +ports or via Unix sockets. A connection test may only be +used within a check process or within a check host service +entry in the Monit control file. .PP If a service listens on one or more sockets, Monit can connect to the port (using either tcp or udp) and verify that the service @@ -2552,7 +2555,7 @@ .SS "\s-1PROGRAM\s0 \s-1STATUS\s0 \s-1TESTING\s0" .IX Subsection "PROGRAM STATUS TESTING" You can check the exit status of a program or a script. This test -may only be used within a program service entry in the Monit +may only be used within a check program service entry in the Monit control file. .PP An example: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/monitrc new/monit-5.3.2/monitrc --- old/monit-5.3.1/monitrc 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/monitrc 2011-12-20 21:40:30.000000000 +0100 @@ -76,21 +76,21 @@ # # and register without credentials # Don't register credentials # # -## Monit by default uses the following alert mail format: -## +## Monit by default uses the following format for alerts if the the mail-format +## statement is missing:: ## --8<-- -## From: monit@$HOST # sender -## Subject: monit alert -- $EVENT $SERVICE # subject +## set mail-format { +## from: monit@$HOST +## subject: monit alert -- $EVENT $SERVICE +## message: $EVENT Service $SERVICE +## Date: $DATE +## Action: $ACTION +## Host: $HOST +## Description: $DESCRIPTION ## -## $EVENT Service $SERVICE # -## # -## Date: $DATE # -## Action: $ACTION # -## Host: $HOST # body -## Description: $DESCRIPTION # -## # -## Your faithful employee, # -## Monit # +## Your faithful employee, +## Monit +## } ## --8<-- ## ## You can override this message format or parts of it, such as subject diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/config.h.in new/monit-5.3.2/src/config.h.in --- old/monit-5.3.1/src/config.h.in 2011-10-25 01:02:01.000000000 +0200 +++ new/monit-5.3.2/src/config.h.in 2011-12-20 21:40:43.000000000 +0100 @@ -283,6 +283,9 @@ /* Define to 1 if you have the <sys/proc.h> header file. */ #undef HAVE_SYS_PROC_H +/* Define to 1 if you have the <sys/protosw.h> header file. */ +#undef HAVE_SYS_PROTOSW_H + /* Define to 1 if you have the <sys/pstat.h> header file. */ #undef HAVE_SYS_PSTAT_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/l.l new/monit-5.3.2/src/l.l --- old/monit-5.3.1/src/l.l 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/l.l 2011-12-20 21:40:30.000000000 +0100 @@ -76,7 +76,7 @@ /* Prototypes */ extern void yyerror(const char*,...); - extern void yywarning(const char *,...); + extern void yywarning(const char *,...); static void steplinenobycr(char *); static void save_arg(void); static void include_file(char *); @@ -734,60 +734,35 @@ static char *handle_quoted_string(char *string) { - char *buf= Str_dup(string); - Str_unquote(buf); Util_handleEscapes(buf); - return buf; - } static void include_file(char *pattern) { - glob_t globbuf; int i; - if ( glob(pattern, GLOB_MARK, NULL, &globbuf) != 0 ) { - - yywarning("include files not found"); - - return; - - } + if (glob(pattern, GLOB_MARK, NULL, &globbuf) != 0) + return; // no include files found for (i = 0; i < globbuf.gl_pathc; i++) { - FILE *yyin; size_t filename_length = strlen(globbuf.gl_pathv[i]); - /* check whenever we have caught a directory - * or file backup copy */ - - if ((filename_length == 0) || - (globbuf.gl_pathv[i][filename_length-1] == '~' ) || - (globbuf.gl_pathv[i][filename_length-1] == '/' )) { - + /* check whenever we have caught a directory or file backup copy */ + if ((filename_length == 0) || (globbuf.gl_pathv[i][filename_length-1] == '~' ) || (globbuf.gl_pathv[i][filename_length-1] == '/' )) continue; - } - yyin = fopen( globbuf.gl_pathv[i], "r" ); - if ( ! yyin ) { - + if (! yyin) yyerror( "failed to include file" ); - - } else { - + else push_buffer_state(yy_create_buffer( yyin, YY_BUF_SIZE ), globbuf.gl_pathv[i]); - - } - } - globfree(&globbuf); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/lex.yy.c new/monit-5.3.2/src/lex.yy.c --- old/monit-5.3.1/src/lex.yy.c 2011-10-25 01:02:27.000000000 +0200 +++ new/monit-5.3.2/src/lex.yy.c 2011-12-20 21:41:18.000000000 +0100 @@ -2770,7 +2770,7 @@ /* Prototypes */ extern void yyerror(const char*,...); - extern void yywarning(const char *,...); + extern void yywarning(const char *,...); static void steplinenobycr(char *); static void save_arg(void); static void include_file(char *); @@ -5691,60 +5691,35 @@ static char *handle_quoted_string(char *string) { - char *buf= Str_dup(string); - Str_unquote(buf); Util_handleEscapes(buf); - return buf; - } static void include_file(char *pattern) { - glob_t globbuf; int i; - if ( glob(pattern, GLOB_MARK, NULL, &globbuf) != 0 ) { - - yywarning("include files not found"); - - return; - - } + if (glob(pattern, GLOB_MARK, NULL, &globbuf) != 0) + return; // no include files found for (i = 0; i < globbuf.gl_pathc; i++) { - FILE *yyin; size_t filename_length = strlen(globbuf.gl_pathv[i]); - /* check whenever we have caught a directory - * or file backup copy */ - - if ((filename_length == 0) || - (globbuf.gl_pathv[i][filename_length-1] == '~' ) || - (globbuf.gl_pathv[i][filename_length-1] == '/' )) { - + /* check whenever we have caught a directory or file backup copy */ + if ((filename_length == 0) || (globbuf.gl_pathv[i][filename_length-1] == '~' ) || (globbuf.gl_pathv[i][filename_length-1] == '/' )) continue; - } - yyin = fopen( globbuf.gl_pathv[i], "r" ); - if ( ! yyin ) { - + if (! yyin) yyerror( "failed to include file" ); - - } else { - + else push_buffer_state(yy_create_buffer(yyin,YY_BUF_SIZE ), globbuf.gl_pathv[i]); - - } - } - globfree(&globbuf); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/net.c new/monit-5.3.2/src/net.c --- old/monit-5.3.1/src/net.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/net.c 2011-12-20 21:40:30.000000000 +0100 @@ -440,9 +440,7 @@ * @return The socket ready for accept, or -1 if an error occured. */ int create_server_socket(int port, int backlog, const char *bindAddr) { - int s; - int status; - int flag = 1; + int s, status, flag = 1; struct sockaddr_in myaddr; if((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { @@ -460,7 +458,7 @@ memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; if((status = getaddrinfo(bindAddr, NULL, &hints, &result)) != 0) { - LogError("%s: Cannot translate '%s' to IP address -- %s\n", prog, bindAddr, gai_strerror(status)); + LogError("%s: Cannot translate '%s' to IP address -- %s\n", prog, bindAddr, status == EAI_SYSTEM ? STRERROR : gai_strerror(status)); goto error; } sa = (struct sockaddr_in *)result->ai_addr; @@ -724,7 +722,7 @@ struct icmp *icmpin = NULL; struct icmp *icmpout = NULL; uint16_t id_in, id_out, seq_in; - int r, i, s, n = 0, read_timeout; + int r, i, s, n = 0, status, read_timeout; struct timeval t_in, t_out; char buf[STRLEN]; double response = -1.; @@ -738,8 +736,8 @@ memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_INET; - if (getaddrinfo(hostname, NULL, &hints, &result) != 0) { - LogError("ICMP echo for %s -- getaddrinfo failed: %s\n", hostname, STRERROR); + if ((status = getaddrinfo(hostname, NULL, &hints, &result)) != 0) { + LogError("ICMP echo for %s -- getaddrinfo failed: %s\n", hostname, status == EAI_SYSTEM ? STRERROR : gai_strerror(status)); return response; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/process/sysdep_AIX.c new/monit-5.3.2/src/process/sysdep_AIX.c --- old/monit-5.3.1/src/process/sysdep_AIX.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/process/sysdep_AIX.c 2011-12-20 21:40:30.000000000 +0100 @@ -101,11 +101,15 @@ #include <sys/proc.h> #endif +#ifdef HAVE_SYS_PROTOSW_H +#include <sys/protosw.h> +#endif + #ifdef HAVE_LIBPERFSTAT_H +#include <sys/protosw.h> #include <libperfstat.h> #endif - #include "process.h" #include "process_sysdep.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/process.c new/monit-5.3.2/src/process.c --- old/monit-5.3.1/src/process.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/process.c 2011-12-20 21:40:30.000000000 +0100 @@ -147,7 +147,7 @@ * Updates the system wide statistic * @return TRUE if successful, otherwise FALSE */ -int update_system_load(ProcessTree_T *pt, int treesize) { +int update_system_load() { if (Run.doprocess) { @@ -280,7 +280,6 @@ } fillprocesstree(pt, root); - update_system_load(*pt_r, *size_r); return *size_r; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/process.h new/monit-5.3.2/src/process.h --- old/monit-5.3.1/src/process.h 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/process.h 2011-12-20 21:40:30.000000000 +0100 @@ -35,7 +35,7 @@ int update_process_data(Service_T s, ProcessTree_T *, int treesize, pid_t pid); int init_process_info(void); -int update_system_load(ProcessTree_T *, int); +int update_system_load(); int findprocess(int, ProcessTree_T *, int); int initprocesstree(ProcessTree_T **, int *, ProcessTree_T **, int *); void delprocesstree(ProcessTree_T **, int *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/util.c new/monit-5.3.2/src/util.c --- old/monit-5.3.1/src/util.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/util.c 2011-12-20 21:40:30.000000000 +0100 @@ -1678,17 +1678,48 @@ void Util_resetInfo(Service_T s) { - memset(s->inf, 0, sizeof *(s->inf)); + s->inf->st_mode = 0; + s->inf->st_uid = 0; + s->inf->st_gid = 0; + s->inf->timestamp = 0; switch (s->type) { + case TYPE_FILESYSTEM: + s->inf->priv.filesystem.f_bsize = 0L; + s->inf->priv.filesystem.f_blocks = 0L; + s->inf->priv.filesystem.f_blocksfree = 0L; + s->inf->priv.filesystem.f_blocksfreetotal = 0L; + s->inf->priv.filesystem.f_files = 0L; + s->inf->priv.filesystem.f_filesfree = 0L; + FREE(s->inf->priv.filesystem.mntpath); + s->inf->priv.filesystem.inode_percent = 0; + s->inf->priv.filesystem.inode_total = 0L; + s->inf->priv.filesystem.space_percent = 0; + s->inf->priv.filesystem.space_total = 0L; + s->inf->priv.filesystem._flags = -1; + s->inf->priv.filesystem.flags = -1; + break; + case TYPE_FILE: + // persistent: st_ino, readpos + s->inf->priv.file.st_size = 0; + s->inf->priv.file.st_ino_prev = 0; + *s->inf->priv.file.cs_sum = 0; + break; case TYPE_PROCESS: - s->inf->priv.process._pid = -1; + s->inf->priv.process._pid = -1; s->inf->priv.process._ppid = -1; - s->inf->priv.process.pid = -1; - s->inf->priv.process.ppid = -1; + s->inf->priv.process.pid = -1; + s->inf->priv.process.ppid = -1; + s->inf->priv.process.status_flag = 0; + s->inf->priv.process.children = 0; + s->inf->priv.process.mem_kbyte = 0L; + s->inf->priv.process.total_mem_kbyte = 0L; + s->inf->priv.process.mem_percent = 0; + s->inf->priv.process.total_mem_percent = 0; + s->inf->priv.process.cpu_percent = 0; + s->inf->priv.process.total_cpu_percent = 0; + s->inf->priv.process.uptime = 0; break; - case TYPE_FILESYSTEM: - s->inf->priv.filesystem._flags = -1; - s->inf->priv.filesystem.flags = -1; + default: break; } } @@ -1847,7 +1878,7 @@ hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; if ((status = getaddrinfo(hostname, NULL, &hints, &info))) { - LogError("%s: Cannot translate '%s' to FQDN name -- %s\n", prog, hostname, gai_strerror(status)); + LogError("%s: Cannot translate '%s' to FQDN name -- %s\n", prog, hostname, status == EAI_SYSTEM ? STRERROR : gai_strerror(status)); snprintf(buf, len, "%s", hostname); // fallback to gethostname() } else snprintf(buf, len, "%s", info->ai_canonname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/monit-5.3.1/src/validate.c new/monit-5.3.2/src/validate.c --- old/monit-5.3.1/src/validate.c 2011-10-25 01:01:51.000000000 +0200 +++ new/monit-5.3.2/src/validate.c 2011-12-20 21:40:30.000000000 +0100 @@ -142,6 +142,7 @@ Run.handler_flag = HANDLER_SUCCEEDED; Event_queue_process(); + update_system_load(); initprocesstree(&ptree, &ptreesize, &oldptree, &oldptreesize); gettimeofday(&systeminfo.collected, NULL); ++++++ monit-dirs.patch ++++++ --- src/monit.h.orig 2012-01-26 00:26:42.798212803 +0100 +++ src/monit.h 2012-01-26 00:27:03.592212063 +0100 @@ -106,11 +106,11 @@ #define LOGMASK 0137 /* Set pid file mode: "-rw-r--r--" */ #define MYPIDMASK 0122 -#define MYPIDDIR PIDDIR +#define MYPIDDIR "@@PIDDIR@@" #define MYPIDFILE "monit.pid" #define MYSTATEFILE "monit.state" #define MYIDFILE "monit.id" -#define MYEVENTLISTBASE "/var/monit" +#define MYEVENTLISTBASE "@@EVENTDIR@@" #define LOCALHOST "localhost" ++++++ monit-vendor-files.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor-files/init/monit.tmpl new/vendor-files/init/monit.tmpl --- old/vendor-files/init/monit.tmpl 2011-11-30 19:00:33.000000000 +0100 +++ new/vendor-files/init/monit.tmpl 2012-01-26 00:24:17.000000000 +0100 @@ -74,12 +74,13 @@ case "$1" in start) echo -n "Starting monit " + /bin/mkdir -p -m0700 "/var/run/monit" if test "yes" = "${MONIT_VIA_INITTAB}"; then echo "via /etc/inittab" "${MONIT_MODIFY_INITTAB}" --add && echo -en "${esc}[1A" else - PID_DIR=$(/bin/basename "$MONIT_PID_FILE") - /bin/mkdir -p -m0700 "$PID_DIR" + PID_DIR=$(/bin/dirname "$MONIT_PID_FILE") + [ -n "$PID_DIR" ] && /bin/mkdir -p -m0700 "$PID_DIR" checkproc -p "${MONIT_PID_FILE}" "${MONIT_BIN}" && \ echo -n " Warning: monit already running. " startproc -p "${MONIT_PID_FILE}" "${MONIT_BIN}" -c "${MONIT_RC_FILE}" ${MONIT_ARGS} -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
