Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sytemd service spring boot app
[Unit]
Description=Java App
Requires=network.target
After=syslog.target
[Service]
User=tomcat
Group=tomcat
#EnvironmentFile=/etc/profile.d/java
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -Xss256k -Xmx128m -Xms128m'
ExecStart=/usr/bin/java -jar /home/app/app.jar
WorkingDirectory=/home/app
SuccessExitStatus=143
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=simple
OOMScoreAdjust=-900
LimitNOFILE=16384
LimitNPROC=16384
LimitAS=infinity
LimitRSS=infinity
LimitCORE=infinity
RestartSec=30
[Install]
WantedBy=multi-user.target
Alias=javajar.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.