snapd-wait
snapd-wait is a small Python3 script that waits for snap autorefresh to complete.
It's primarily intended to be run on boot and is particularly useful when provisioning your system.
For example, if you use a Terraform/Packer provisioner that calls a program installed via snap, you'll get miscellaneous failures saying that program doesn't exist (because snapd is updating it).
Usage
$ snapd-wait --help
usage: snapd-wait [-h] [--delay DELAY] [--max-wait-time MAX_WAIT_TIME] [--sleep SLEEP] [--timeout TIMEOUT]
optional arguments:
-h, --help show this help message and exit
--delay DELAY Delay updates for n minutes (<=0 disables)
--max-wait-time MAX_WAIT_TIME
Maximum time in minutes to wait for snapd (<=0 disables)
--sleep SLEEP Time in seconds to sleep between calls to snap
--timeout TIMEOUT Time in seconds to wait for snap to complete
What it does
- Delays the next refresh by 6 hours (snapd autorefreshes 4 times a day by default)
- Waits for all changes to finish by calling
snap changes, essentially using this method, until every change is marked asDone.
References
- https://serverfault.com/questions/967674/how-to-wait-for-snapd-auto-refresh-to-complete
- https://popey.com/blog/2021/05/disabling-snap-autorefresh/
Development
Installation
Create a virtual environment, then install as follows:
pip install -e[dev]
Build/Test
make
Release files for snapd-wait 1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snapd-wait-1.0.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snapd_wait-1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.1 kB
Release files / snapd-wait-1.0.tar.gz
| Download URL | snapd-wait-1.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e9844a2906111bacf183bffc698148530a38a8b6c1e3aa3372968f55daf7450
|
|
BLAKE2b-256 checksum How to use checksums |
cc3037593a75f5102e2319be4c85c4608fb3e0bdf5bfac5478a5f1adce834b13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.9
|
Release files / snapd_wait-1.0-py3-none-any.whl
| Download URL | snapd_wait-1.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1eb2bb885ca4e15207973dfd3c5940eea41bd1f287040788bbec85f72f551d56
|
|
BLAKE2b-256 checksum How to use checksums |
3ebe93b071a0179a52c5ac2f85244dd9fa6003d46637070ac453f28c95de32fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.9
|