The officially official Devuan Forum!

You are not logged in.

#1 2025-04-30 07:30:46

IdeaFix
Member
Registered: 2020-01-02
Posts: 31  
Website

Tomcat problems in Devuan

Hi. I have some problems with tomcat:

1. It is unclear for me how to change running user. All modern manuals are for systemd. I tried to edit /etc/defaults/tomcat in tomcat7 style, but it is not working fine. I tried to edit /etc/init.d/tomcat9, but... Deviuan is not LFS.

2. It is unclear for me how tomcat security is working now. In systemd based systems I usually need only to put RW paths in unit file. In devuan I tried ro use tomcat9 security switch in /etc/defaults/tomcat and additional configs in policy.d. It is working now, but I found no documentation about it.

3. It is unclear for me how to run tomcat in 80 port on modern devuan. I want to find a silution wothout firewalls anp proxies. Solutions form tomcat7 and systemd based solutions are not working.

3. "Too many open files". Now i see 1024 when run "ulimit -n". I can run "ulimit -n 4096", but i can not store 4096 after reboot. I tried to add in /etc/security/limits.conf something like this

* soft nofile 2048
* hard nofile 2048

But i see 1024 after reboot. I need to change this option only for "tomcat" process or "tomcat" user. All manuals are about how to edit systemd unit to make another limit value.

Last edited by IdeaFix (2025-04-30 07:56:46)

Offline

#2 2025-04-30 10:19:31

IdeaFix
Member
Registered: 2020-01-02
Posts: 31  
Website

Re: Tomcat problems in Devuan

I also see no "pam_limits.so"

here:
/etc/pam.d/common-session-noninteractive
/etc/pam.d/common-session

Offline

#3 2025-04-30 11:27:51

IdeaFix
Member
Registered: 2020-01-02
Posts: 31  
Website

Re: Tomcat problems in Devuan

i made "nofile = 65535" for tomcat and "nofile = 16384" for root... after restarting tomcat, i see a changes - 1st tomcat process have nofile=16384 (cat /proc/1st_pid/limits) and ither processes has 8192.

nofile for root allows to change 1st tomcat process configuration, but not others. How to change nofile for tomcat, runned by init script?

In systemd i can make something like this:

[Service]
Type=forking
User=tomcat
Group=tomcat
LimitNOFILE = 65535

Is it possible to make the same thing in /etc/defaults/tomcat?

Offline

#4 2025-04-30 14:33:19

IdeaFix
Member
Registered: 2020-01-02
Posts: 31  
Website

Re: Tomcat problems in Devuan

I found here that there is no pam_limits.so in common-session-noninteractive and common-session by design. Apache 2 can be preconfiured via /etc/apache2/envvars and what about tomcat? All manuals are only about systemd.

Now i put ulimit -n 16384 directly in  /etc/init.d/tomcat9 and it is working, but what is the right way?

Offline

Board footer