[Bug 226907] databases/mongodb36: failed to start mongod due to "limits: NO: No such file or directory"

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 25 02:04:23 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226907

            Bug ID: 226907
           Summary: databases/mongodb36:  failed to start mongod due to
                    "limits: NO: No such file or directory"
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: 0mp at FreeBSD.org
                CC: dev at dudu.ro
                CC: dev at dudu.ro
             Flags: maintainer-feedback?(dev at dudu.ro)

When I try to start mongod with:

    sudo service mongod onestart

I get the following output:

> Starting mongod.
> limits: NO: No such file or directory
> /usr/local/etc/rc.d/mongod: WARNING: failed to start mongod

I've not modified any configuration files yet.

It looks like it is a problem with the `mongod_limits` knob, which has the
following description: "Set to "NO" by default. Set it to yes to run `limits -e
-U mongodb`".

I decided to add `set -x` to /usr/local/etc/rc.d/mongod. It turns out that
`mongod_limits` is an unfortunate name because of the line 1078 in
/etc/rc.subr:

    _doit="$_cd limits -C $_login_class $_limits $_doit"

`_limits` is a variable set in line 957:

    _limits=\$${name}_limits    _oomprotect=\$${name}_oomprotect

whereas `${name}_limits` is described as follows: 

    #   Name            Needed  Purpose
    #   ${name}_limits  n       limits(1) to apply to ${command}.

I believe that we have a name collision here as with `set -x` we can see that
following command is executed (resulting in "limits: NO: No such file or
directory"):

    limits -C daemon NO su -m mongodb -c 'sh -c "/usr/local/bin/mongod
--logpath /var/db/mongodb/mongod.log --logappend --config
/usr/local/etc/mongodb.conf --dbpath /var/db/mongodb --fork >/dev/null
2>/dev/null"'

After renaming `mongod_limits` to `mongod_run_limits` in
/usr/local/etc/rc.d/mongod the service runs just fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list