You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Roberto Resoli (JIRA)" <ji...@apache.org> on 2010/12/23 17:34:03 UTC

[jira] Created: (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
-----------------------------------------------------------------------------------

                 Key: DAEMON-192
                 URL: https://issues.apache.org/jira/browse/DAEMON-192
             Project: Commons Daemon
          Issue Type: Improvement
          Components: Jsvc
         Environment: Linux, maybe all Unixes
            Reporter: Roberto Resoli
            Priority: Minor


When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12982757#action_12982757 ] 

Mladen Turk commented on DAEMON-192:
------------------------------------

This is not portable solution
Think we could add a special -rlimit configuration with param that would set soft/hard limit for
the -user.
E.g -rlimit [S|H]n=1000 -rilimit  T=unlimited
Where 'n' stands for open file descriptors and 'T' for maximum number of threads
using the bash ulimit params.




> Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
> -----------------------------------------------------------------------------------
>
>                 Key: DAEMON-192
>                 URL: https://issues.apache.org/jira/browse/DAEMON-192
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>         Environment: Linux, maybe all Unixes
>            Reporter: Roberto Resoli
>            Priority: Minor
>
> When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
> This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Resolved] (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DAEMON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mladen Turk resolved DAEMON-192.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.6

Resolving by updated Tomcat7.sh in samples directory.
It has an example of how to set the maximum fd's before
running the daemon.
One can use and customize a give recipe.

> Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
> -----------------------------------------------------------------------------------
>
>                 Key: DAEMON-192
>                 URL: https://issues.apache.org/jira/browse/DAEMON-192
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>         Environment: Linux, maybe all Unixes
>            Reporter: Roberto Resoli
>            Priority: Minor
>             Fix For: 1.0.6
>
>
> When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
> This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Posted by "Roberto Resoli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983056#action_12983056 ] 

Roberto Resoli commented on DAEMON-192:
---------------------------------------

I agree. In the meantime, I found that setting limits it's only matter to run ulimit ( in order to set max number of open files, for example: "ulimit -n <max number of open files>" ) just before of launching jsvc. 
The limits are retained even when jsvc running user is downgraded.

> Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
> -----------------------------------------------------------------------------------
>
>                 Key: DAEMON-192
>                 URL: https://issues.apache.org/jira/browse/DAEMON-192
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>         Environment: Linux, maybe all Unixes
>            Reporter: Roberto Resoli
>            Priority: Minor
>
> When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
> This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Posted by "Roberto Resoli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983273#action_12983273 ] 

Roberto Resoli commented on DAEMON-192:
---------------------------------------

I definitely agree! Examples would be really useful, since many hints on the web about this subject suggest that setting ulimits is only matter to modify /etc/security/limits.conf . 
Unfortunately this is absolutely not true, since that configuration file is enforced only at login time.



> Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
> -----------------------------------------------------------------------------------
>
>                 Key: DAEMON-192
>                 URL: https://issues.apache.org/jira/browse/DAEMON-192
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>         Environment: Linux, maybe all Unixes
>            Reporter: Roberto Resoli
>            Priority: Minor
>
> When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
> This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DAEMON-192) Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits

Posted by "Mladen Turk (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12983066#action_12983066 ] 

Mladen Turk commented on DAEMON-192:
------------------------------------

Hmm, since it's hardly that jsvc will be invoked outside the shell think that setting ulimit directly will
be much better solution then playing with setrlimit system calls within jsvc.
Giving a notice and an example in documentation would be much better then
breaking compatibility by introducing a new cmdline option.

Think I'll resolve this case by updating the documentation and couple of example scripts.


> Make jsvc enforce /etc/security/limits.conf , or add a parameter for setting limits
> -----------------------------------------------------------------------------------
>
>                 Key: DAEMON-192
>                 URL: https://issues.apache.org/jira/browse/DAEMON-192
>             Project: Commons Daemon
>          Issue Type: Improvement
>          Components: Jsvc
>         Environment: Linux, maybe all Unixes
>            Reporter: Roberto Resoli
>            Priority: Minor
>
> When launched with -user parameter, jsvc downgrades user via setuid() system call, but the operating system limits (max number of open files, for example) remains the same. 
> This is not convenient for running daemons (like Tomcat) which very often need a customization of such limits. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.