membersound
membersound

Reputation: 86747

How to add command line args to java systemd service?

How can I add command line arguments correctly to a java systemd service? In the following example, -Dspring.profiles.active=test is not taken into account. Thus the location is maybe wrong?

[Unit]
Description=Manage Java service

[Service]
WorkingDirectory=/opt/prod
ExecStart=/bin/java -Xms128m -Xmx256m -jar myapp.jar -Dspring.profiles.active=test
User=java
Type=simple
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Upvotes: 0

Views: 704

Answers (1)

membersound
membersound

Reputation: 86747

myapp.jar --spring.profiles.active=test

Upvotes: 1

Related Questions