Opened 2 years ago

Closed 2 years ago

#64403 closed defect (invalid)

samba4 @4.15.3: set_maxfiles: setrlimit for RLIMIT_NOFILE for 16424 files failed with error Invalid argument

Reported by: BjarneDMat Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc:
Port: samba4

Description (last modified by BjarneDMat)

#=> system_profiler SPHardwareDataType SPSoftwareDataType
Hardware:
      Model Name: Mac mini
      Model Identifier: Macmini2,1
      Processor Name: Intel Core 2 Duo
Software:
      System Version: Mac OS X 10.6.8 (10K549)
      Kernel Version: Darwin 10.8.0

So, I've got samba4 to compile & install

Now, when I'm trying to run it I get :

#=> smbd --foreground --configfile=/opt/local/etc/samba4/smb.conf --interactive
smbd version 4.15.3 started.
Copyright Andrew Tridgell and the Samba Team 1992-2021
INFO: Profiling support unavailable in this build.
daemon_status: daemon 'smbd' : Starting process ...
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /opt/local/var/lib/samba/private/secrets.tdb file.
set_maxfiles: setrlimit for RLIMIT_NOFILE for 16424 files failed with error Invalid argument

Terminated

When I search the source for this, I get :

#=> grep -Rn RLIMIT_NOFILE *
python/samba/netcmd/user.py:2674:            maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
script/autobuild.py:1408:    maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
source3/lib/util.c:1279:#if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE))
source3/lib/util.c:1283:	if(getrlimit(RLIMIT_NOFILE, &rlp)) {
source3/lib/util.c:1284:		DEBUG(0,("set_maxfiles: getrlimit (1) for RLIMIT_NOFILE failed with error %s\n",
source3/lib/util.c:1311:		if(setrlimit(RLIMIT_NOFILE, &rlp)) {
source3/lib/util.c:1312:			DEBUG(3,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d max files failed with error %s\n", 
source3/lib/util.c:1325:	if(setrlimit(RLIMIT_NOFILE, &rlp)) {
source3/lib/util.c:1326:		DEBUG(0,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d files failed with error %s\n", 
source3/lib/util.c:1332:	if(getrlimit(RLIMIT_NOFILE, &rlp)) {
source3/lib/util.c:1333:		DEBUG(0,("set_maxfiles: getrlimit (2) for RLIMIT_NOFILE failed with error %s\n",
source3/lib/util.c:1348:#else /* !defined(HAVE_GETRLIMIT) || !defined(RLIMIT_NOFILE) */
source3/param/loadparm.c:301:#if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE))
source3/param/loadparm.c:307:		if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
source4/heimdal/lib/roken/getdtablesize.c:71:#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE)
source4/heimdal/lib/roken/getdtablesize.c:73:  if (getrlimit(RLIMIT_NOFILE, &res) == 0)

So, it looks as if it's source3/lib/util.c:1326 that's the issue

Any ideas as to how I can fix this ?!?

Change History (9)

comment:1 Changed 2 years ago by BjarneDMat

Summary: [samba4][samba4] set_maxfiles: setrlimit for RLIMIT_NOFILE for 16424 files failed with error Invalid argument

comment:2 Changed 2 years ago by BjarneDMat

Description: modified (diff)

comment:3 Changed 2 years ago by jmroot (Joshua Root)

Setting RLIMIT_NOFILE to a value greater than OPEN_MAX will fail. So the value passed to setrlimit needs to be capped at OPEN_MAX.

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: [samba4] set_maxfiles: setrlimit for RLIMIT_NOFILE for 16424 files failed with error Invalid argumentsamba4 @4.15.3: set_maxfiles: setrlimit for RLIMIT_NOFILE for 16424 files failed with error Invalid argument
Version: 2.7.1

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

This samba code appears to have been unchanged for 21-22 years.

In any case, file a bug report with the developers so they can fix it?

comment:6 Changed 2 years ago by BjarneDMat

Reported to samba dev w/ relevant trac issues.

I didn't have an account w/ them, so I'll have to wait for them to accept me before I can list a bugzilla.sam.org bug #

comment:8 Changed 2 years ago by BjarneDMat

please mark as RESOLVED INVALID
seems to be an instance of https://bugzilla.samba.org/show_bug.cgi?id=11897

comment:9 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.