使用Chef时,主管打开文件的限制不会改变 [英] Supervisor open file limit won't change when using Chef
问题描述
我正在修改计算机上的/etc/security/limits.conf,然后在Chef食谱中安装Supervisor.配方运行完成后,如果运行cat /proc/<process id>/limits
,我会看到:
I am modifying /etc/security/limits.conf on the machine, and then installing Supervisor in a Chef recipe. After the recipe run finishes, 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
如果我登录计算机并运行service supervisor restart
,则会正确设置最大打开文件数.但是,如果我在配方中运行此命令(在安装主管后,在配方末尾,则可以执行任何操作),该限制不会更改.直到我登录并手动运行该命令,该限制才会更改.
If I log into the machine and run service supervisor restart
, the max open files is then set correctly. However, if I run this command in the recipe (right after installing supervisor, at the very end of the recipe, anything) the limit does not change. It is not until I log in and manually run that command that the limit changes.
我怎样才能获得主管使用厨师食谱更改的打开文件限制?操作系统是Ubuntu 12.04.
How can I get the open file limit for supervisor to change using the chef recipe? Operating system is Ubuntu 12.04.
推荐答案
To any weary googlers: you might be looking for the minfds
setting in the supervisor config. This setting seems to take effect for both the supervisord process as well as the children. I had a number of other strategies, including launching a shell script that set the limits before executing the actual program, but this was the only thing that worked.
这篇关于使用Chef时,主管打开文件的限制不会改变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!