1
votes

Trying to change default open file limit value for spring-boot application (in Debian based system), which is started as init (System V) script, but I have difficulties finding a solution:

  1. General recommendation is to add ulimit -n line to /etc/init.d/. Not possible, since in spring-boot case it's just a symlink to jar file.
  2. spring-boot itself does not provide environment property or any convenient mechanism to do that.
  3. /etc/security/limits.conf is not a solution either (does not effect daemons started during init)

Any ideas? Thanks

1

1 Answers

0
votes

I am not a spring-boot expert, but the (awesome) fact that you can simply create a symlink should not mean that you have to do it. Simple init script like this should do:

[root@localhost app]# cat /etc/init.d/myapp
#!/bin/bash
ulimit -n 50001
/var/myapp/myapp.jar $1