Update template.service

Implement auto-restart with systemd
This commit is contained in:
Adrien 2024-07-20 09:29:05 +07:00 committed by GitHub
parent 90d945cb2c
commit 2b0103808a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,5 +7,9 @@ User=${pkg.user}
ExecStart=${pkg.installFolder}/bin/${pkg.name}.jar ExecStart=${pkg.installFolder}/bin/${pkg.name}.jar
SuccessExitStatus=143 SuccessExitStatus=143
# Service shall be restarted in 30 seconds when the service process exits, is killed, or a timeout is reached.
Restart=always # default 'no'
RestartSec=30
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target