ansible/roles/minecraft/templates/minecraft.service.j2

20 lines
531 B
Plaintext
Raw Normal View History

2019-10-05 21:41:47 +00:00
# {{ ansible_managed }}
[Unit]
2020-01-23 02:16:31 +00:00
Description=Minecraft server %i
2019-10-05 21:41:47 +00:00
After=network.target
[Service]
2019-10-27 23:36:54 +00:00
ExecStart=/usr/bin/java -Xmx{{ minecraft_java_xmx | default('1024M') }} -Xms{{ minecraft_java_xms | default('1024M') }} -jar {{ minecraft_opt_path }}/bin/server.jar nogui
SuccessExitStatus=143
2019-10-05 21:41:47 +00:00
Type=simple
User={{ minecraft_user }}
Group={{ minecraft_group }}
2020-01-23 02:16:31 +00:00
WorkingDirectory={{ minecraft_var_path }}/%i
2019-10-05 21:41:47 +00:00
Restart=on-failure
SyslogIdentifier=minecraft
2019-10-27 23:36:54 +00:00
SyslogFacility={{ minecraft_syslog_facility }}
2019-10-05 21:41:47 +00:00
[Install]
WantedBy=multi-user.target