Comment 6 for bug 938669

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 938669] Re: upstart jobs do not respect /etc/security/limits.conf

Excerpts from Van Stokes, Jr.'s message of 2013-04-30 16:08:24 UTC:
> The fix around this issue is a poor solution. We were just hit hard with this very issue running MySQL server on Ubuntu 12.04 LTS. We increased the size of the server and the open files limit and Ubuntu would not honor it. It took many many man hours to stuble onto a post describing the problem and the solution.
> Details can be found here: http://askubuntu.com/questions/288471/mysql-cant-open-files-after-updating-server-errno-24
>

I can understand your frustration, this is a confusing area. However,
PAM is intended as a user oriented library, and daemons are by definition
not users.

In man limits.conf, it is clearly stated:

       Also, please note that all limit settings are set per login. They
       are not global, nor are they permanent; existing only for the
       duration of the session.

mysqld does not have a session, and should not have a session. If that
file worked for daemons in the past, it was by accident because they
were started directly from user sessions. This is precisely why upstart
has the ability to specify ulimits for system daemons like mysqld.

Note that sysctl could also be used to raise the system wide open
files limit.