mirror of
https://github.com/FAUSheppy/systemd-socket-activation-template
synced 2025-12-06 23:11:35 +01:00
Initial
This commit is contained in:
32
example.service
Normal file
32
example.service
Normal file
@@ -0,0 +1,32 @@
|
||||
[Unit]
|
||||
Description=minecraft server
|
||||
After=network.target
|
||||
Requires=sheppy-minecraft-autodeactivate.timer
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=minecraft
|
||||
WorkingDirectory=/home/minecraft/server/
|
||||
Nice=2
|
||||
CPUAffinity=0,3
|
||||
|
||||
## exit status of mcrcon on success, 143 ist SIGTERM in java, the default for mc
|
||||
SuccessExitStatus=2 3 143 255
|
||||
|
||||
ExecStart=/absolute/path/to/example.sh
|
||||
ExecStop=pkill example.sh
|
||||
|
||||
TimeoutStopSec=30
|
||||
Restart=always
|
||||
RestartSec=60
|
||||
|
||||
## RES CONTROL ##
|
||||
MemoryLow=2G
|
||||
MemoryHigh=4G
|
||||
## Java VM Limit is 4GB so this should never happen ##
|
||||
MemoryMax=6G
|
||||
CPUQuota=100%
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user