Monit 5.22.0 Err#9 EBADF Solaris 10 with latest Patches

Issue #616 resolved
Klaus Jürgens created an issue

After applying latest solaris patches monit loops with Err#9 EBADF. A locally compiled version does the same.

root#sol-backup1:/opt/monit/monit-5.22.0/bin:>cat /etc/release 
                    Oracle Solaris 10 1/13 s10x_u11wos_24a X86
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013

root#sol-backup1:/opt/monit/monit-5.22.0/bin:>uname -a
SunOS sol-backup1 5.10 Generic_150401-50 i86pc i386 i86pc

root#sol-backup1:/opt/monit/monit-5.22.0/bin:>ldd ./monit =>     /lib/64/ =>   /lib/64/ =>         /lib/64/ =>        /lib/64/ =>   /lib/64/ =>       /lib/64/ =>        /lib/64/ =>   /lib/64/ =>        /lib/64/ =>     /lib/64/ =>   /lib/64/ =>       /lib/64/ =>         /lib/64/ =>   /lib/64/ =>         /lib/64/ =>   /lib/64/ =>   /lib/64/ =>   /lib/64/ =>    /lib/64/ =>  /lib/64/ =>    /lib/64/ =>   /lib/64/ =>   /lib/64/ =>  /lib/64/ =>  /lib/64/
root#sol-backup1:/opt/monit/monit-5.22.0/bin:>ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) unlimited
pipe size            (512 bytes, -p) 10
stack size              (kbytes, -s) unlimited
cpu time               (seconds, -t) unlimited
max user processes              (-u) 27589
virtual memory          (kbytes, -v) unlimited

Comments (5)

  1. Tildeslash repo owner

    When monit starts it tries to close all filedescriptors except stdin, stdout and stderr up to maximum allowed number of filedescriptors. The limit is returned by getdtablesize() call - in your case ulimit reports "unlimited", as getdtablesize() return "signed int", it may be up to 2^31 (2 147 483 648), which will probably block monit in the close loop for some time.

    Please can you try to set filedescriptors limit for monit to for example 1024? (monit needs usually just few filedescriptors).

  2. Klaus Jürgens reporter

    Thank you for the explanation of monits behaviour. Setting the fd limit to 1024 is the solution.

    root#sol-backup1:/opt/monit/monit-5.22.0:>ulimit -n 1024     
    root#sol-backup1:/opt/monit/monit-5.22.0:>bin/monit -t  
    Cannot find the Monit control file at ~/.monitrc, /etc/monitrc, /usr/local/etc/monitrc, /usr/local/etc/monitrc or at ./monitrc 
  3. Tildeslash repo owner

    Fixed: Issue #616: If no filedescriptors limit is set when Monit starts, Monit may freeze for a long time during startup and when executing start/stop methods or program checks.

    → <<cset 616cf523912f>>

  4. Log in to comment