Limit open supervisor file will not change when using a chef

I modify /etc/security/limits.conf on the machine and then install Supervisor in the chef's recipe. After completing the recipe, if I run cat /proc/<process id>/limits, I see:

Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max open files            1024                 4096                 files

If I log into the machine and run service supervisor restart, the maximum open files will be installed correctly. However, if I run this command in the recipe (immediately after installing the supervisor, at the very end of the recipe, whatever), the limit does not change. Only after I log into the system and manually run this command does this limit change.

How can I get a restriction on opening a file for a supervisor to modify it using a chef's recipe? The operating system is Ubuntu 12.04.

+4
source share
3 answers

For all tired googlers: you can look for a setting minfdsin the supervisor configuration . This option seems to take effect for both the supervisor process and the children. I had several other strategies, including running a shell script that set limits before running a real program, but that was the only thing that worked.

+7
source

I did not test my computer because now I can not stop the supervisor. But if you reorder the / etc / rc directory?

# find /etc/rc* -iname "*super*"
/etc/rc0.d/K01supervisor
/etc/rc1.d/K01supervisor
/etc/rc2.d/S16supervisor
/etc/rc3.d/S16supervisor
/etc/rc4.d/S16supervisor
/etc/rc5.d/S16supervisor
/etc/rc6.d/K01supervisor

I have the same Supervisord and ulimit problem for java application

0
source

The supervisor implementation is such that the process can be started as a non-root user with more privileges than this user - bypassing pam, limits.conf, etc. Therefore, I doubt that this problem will be fixed. Take a look at https://github.com/Supervisor/supervisor/pull/229

0
source

All Articles