Bug 34514 - Samba Daemon is started with nofile 1024 after Boot
Samba Daemon is started with nofile 1024 after Boot
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 3.2
Other Linux
: P5 normal (vote)
: UCS 3.2-3-errata
Assigned To: Arvid Requate
Felix Botner
:
: 36165 (view as bug list)
Depends on:
Blocks: 36216
  Show dependency treegraph
 
Reported: 2014-04-09 15:09 CEST by Tim Petersen
Modified: 2014-10-22 16:07 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Petersen univentionstaff 2014-04-09 15:09:42 CEST
Snipped output:

root@ucs3-dc4:~# ulimit -n
32768
root@ucs3-dc4:~# ps aux | grep samba
root      1319  0.0  3.2 946788 33448 ?        S    15:00   0:00 /usr/sbin/samba -D
root      2072  0.0  0.0   9668   840 pts/0    S+   15:03   0:00 grep samba

root@ucs3-dc4:~# cat /proc/1319/limits 
Limit                     Soft Limit           Hard Limit           Units     
Max open files            1024                 4096                 files    


The problem is that limits configured via ucr or in limits.conf are getting evaluated after the initial start of the samba daemon in boot phase.

So after a reboot the samba daemon runs with the default values (1024|4096). In most environments this is no problem, but at least one customer reported that the default wasn't enough: 

Workaround: ulimit -n value in init script itself. This should be considered as an own ucr variable (for slapd such things are made hard coded in /etc/rc*.d/S14slapd).
Comment 1 Stefan Gohmann univentionstaff 2014-10-14 08:59:51 CEST
*** Bug 36165 has been marked as a duplicate of this bug. ***
Comment 2 Arvid Requate univentionstaff 2014-10-14 21:49:10 CEST
The init script now uses ulimit -n to set the value via UCR samba/max_open_files also for the main "samba" processes.

Advisory: 2014-10-13-samba.yaml
Comment 3 Felix Botner univentionstaff 2014-10-15 10:59:19 CEST
FAIL - UCS 4.0 ??

OK - YAML

OK - works with errata3.2-3

-> reboot
-> ssh 10.200...

root@master:-> for i in $(pidof samba smbd nmbd); do cat /proc/$i/limits | \
               grep "Max open file" ; done
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files     
Max open files            32828                32828                files     
Max open files            32828                32828                files     
Max open files            32808                32808                files     
Max open files            32808                32808                files
Comment 4 Arvid Requate univentionstaff 2014-10-15 11:12:56 CEST
> FAIL - UCS 4.0 ??

Should be there, see 4.0-0-0-ucs/2:4.2.0~rc1-1.
Comment 5 Felix Botner univentionstaff 2014-10-15 11:24:22 CEST
(In reply to Arvid Requate from comment #4)
> > FAIL - UCS 4.0 ??
> 
> Should be there, see 4.0-0-0-ucs/2:4.2.0~rc1-1.

OK,
Comment 6 Arvid Requate univentionstaff 2014-10-15 11:56:04 CEST
Just in case someone is wondering about the peculiar default value for samba/max_open_files which is applied here:

32808 = 2 x 16404 (see bug 24165).

16404 used to be some default in Samba (don't ask).
Recently their loadparm default was adjusted to 16384 (= 32768 / 2).
Sounds like a compelling reason to adjust our default as well. At some point.
Comment 7 Janek Walkenhorst univentionstaff 2014-10-16 13:42:42 CEST
http://errata.univention.de/ucs/3.2/221.html
Comment 8 Janek Walkenhorst univentionstaff 2014-10-22 16:07:32 CEST
http://errata.univention.de/ucs/3.2/224.html