boat resume to get it back.
What a stop does
Boat does these steps in this order:- Boat runs your pre-stop command, if you have one.
- Boat stops your Docker containers. Each container gets 30 seconds to exit.
- Boat takes the last snapshot of the disk.
- Boat turns off the machine and removes it.
- Clean up when the sandbox starts again. An enabled systemd service with an
ExecStartPre=step runs at every resume. Read Long-Running Tasks. - Run your own cleanup first, then run
boat stop.
Save app state before a stop
Some apps keep recent changes in memory. They write them to disk later. Chrome is an example. Chrome writes new cookies to disk every 30 seconds, or when it closes. If you stop the sandbox a few seconds after a login, the snapshot has the old cookies. A kill signal does not help, because Chrome then exits without saving. To fix this, put a command in the file~/.boat/pre-stop. Boat runs it at every stop, before the last snapshot.
The example below closes Chrome. It needs Chrome to have a debug port. Start Chrome with --remote-debugging-port=9222.
- It runs as
user, in your home folder. - It has 60 seconds. After that, Boat stops it.
- It runs on
boat stopand on auto-stop. - It does not run on
boat stop --force. It does not run when you save a named snapshot. - If it fails or takes too long, the stop continues.
- The file is on the disk. Resumes, forks and templates keep it.
When a stop is refused
A stop saves the disk first. If the save fails, Boat refuses the stop. The sandbox keeps running, so you do not lose work. Boat tries again by itself and sends you an email. You do not pay while the stop waits. Billing pauses at the first refused stop. Your balance and your invoice both show the pause. You do not need to ask for a refund.- The pause continues while the stop waits, even if you or your scripts use the sandbox.
- The pause ends when the sandbox stops.
- The pause also ends when you resume the sandbox, because a resume cancels the stop.
- If the refused stop was an auto-stop, the pause ends when you use the sandbox again.
boat stop --force. The sandbox stops with its last good snapshot. You lose everything written after that snapshot.
After 3 days of failed saves, Boat does a forced stop by itself. Boat sends you an email before it does this.