Hi,
Finally I deploy a jar.
First I create a user and a group with home directory for this user with out login shell.
I put my jar file in this home and I create system service in, /etc/systemd/system/genedatabank.service, to start my application like this:
[Unit]
Description=GeneDataBank java server application
Wants=network-online.target
After=network-online.target
[Service]
User=genedatabank
Group=genedatabank
Restart=always
Type=simple
ExecStart=/usr/lib/jvm/java-17-openjdk-amd64/bin/java \
-jar /opt/genedatabank/genedatabank.jar \
--server.port=8090
[Install]
WantedBy=multi-user.target
If I start the application with systemctl start genedatabank.service
application start but not create/have access to directory .jmix/work and if I start with sudo -u genedatabank java -jar genedatabank.jar --server.port=8090
in directory /opt/genedatabank
application start and can create/have access to .jmix/work...
So finally:
root@server:/opt/genedatabank# sudo -u genedatabank java -jar genedatabank.jar --server.port=8090
is correct, and
root@server:/# sudo -u genedatabank java -jar /opt/genedatabank/genedatabank.jar --server.port=8090
is not correct
What is argument necessary to add at my command to start correctly?
Thank you!
LE. > Home directory is /opt/genedatabank