Implement time to live to determine when to shutdown
This commit is contained in:
9
services/ensure_running.service
Normal file
9
services/ensure_running.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Launch minecraft server
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/ubuntu/minecraft/ensure_running.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
9
services/set_initial_ttl.service
Normal file
9
services/set_initial_ttl.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=Let server live for 1h after initial boot
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c 'date -d "+1 hour" > /home/ubuntu/minecraft/live_until.txt'
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user