#=> 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 samba 4.15.3 to compile & install Now, when I'm trying to run it I get : 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 ?!? Comment (by jmroot): 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. https://trac.macports.org/ticket/64403 https://trac.macports.org/ticket/64396
smbd started with : #=> smbd \ --foreground \ --configfile=/opt/local/etc/samba4/smb.conf \ --interactive
please close as invalid the problem was something entirely else : https://bugzilla.samba.org/show_bug.cgi?id=11897