Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,8 @@ On startup the `server.properties` file is checked and, if applicable, a warning

The utility used to wake the server (`knock(d)`) works at network interface level. So the correct interface has to be set using the `AUTOPAUSE_KNOCK_INTERFACE` variable when using non-default networking environments (e.g. host-networking, Portainer oder NAS solutions). See the description of the variable below.

A file called `.paused` is created in `/data` directory when the server is paused and removed when the server is resumed. Other services may check for this file's existence before waking the server.

A starting, example compose file has been provided in [examples/docker-compose-autopause.yml](examples/docker-compose-autopause.yml).

### Enabling Autopause
Expand Down
3 changes: 3 additions & 0 deletions files/auto/pause.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^S.*$ ]] ; t
# finally pause the process
logAutopauseAction "Pausing Java process"
pkill -STOP java

# create .paused file in data directory
touch /data/.paused
fi
3 changes: 3 additions & 0 deletions files/auto/resume.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ if [[ $( ps -ax -o stat,comm | grep 'java' | awk '{ print $1 }') =~ ^T.*$ ]] ; t
logAutopauseAction "Knocked from $1, resuming Java process"
echo "$1" > /var/log/knocked-source
pkill -CONT java

# remove .paused file from data directory
rm -f /data/.paused
fi