Pier, etc. on ubuntu 12.10

When starting a Jetty project in IntelliJ, I have no problem reading the environment variable that I set in / etc / environment using System.getenv ("var1") api.

When I deploy war on an Ubuntu server that runs Jetty on boot, I get null when I call System.getenv ("var1")

When I run a simple console application on the server under my user (user suder), I get the environment variable now.

What do I need to do so that the environment variables in / etc / environment are visible to the war when it starts automatically outside the user's session?

+1
source share
1 answer

I think I needed to set this up in jetty.sh when I was getting things working on an elastic beanstalk ...

In the jetty.sh script file, you can specify the / etc / environment file and they will be present. If this is what you are looking for then open the error and we will add it to the jetty.sh script file for the next version.

+1
source

Source: https://habr.com/ru/post/982889/


All Articles