Repository navigation
Conversation
|
@roosterfish this adds |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved blocking issues were identified.
No open issues 🎉
What changed in this PR
Adds snap configuration for daemon debug logging and dqlite tracing, with validation and documentation.
Changes:
- Adds
daemon.debuganddb.tracestartup handling. - Validates both options via the configure hook.
- Documents configuration usage.
| File | Summary |
|---|---|
snapcraft/commands/daemon.start |
Applies debug and tracing settings at startup. |
snap/hooks/configure |
Validates snap configuration values. |
doc/how-to/snaps.md |
Documents the new snap options. |
Review effort: Lite
roosterfish
left a comment
There was a problem hiding this comment.
Thanks for this! To make it more accessible for users, please also add a note to the snapcraft.yaml, similar to how it's done in LXD ("Supported configuration options for the snap (snap set lxd [=...]):").
ddae415 to
1a10cbd
Compare
|
@roosterfish I addressed both points: the configure hook now rejects unsupported keys (402ec9f), and the snap description lists the supported options in the same style as LXD (1a10cbd). I also rebased onto |
|
@roosterfish I fixed how the configure hook reads the config: it now uses |
31352da to
25e972e
Compare
|
@roosterfish I simplified the configure hook as you suggested: it now just compares each set key against |
Reject unsupported config keys and validate the daemon.debug and db.trace config keys. Signed-off-by: Waleed Khalid <wak327@gmail.com>
…ite tracing Pass --debug to the daemon if daemon.debug is set to true. Set LIBDQLITE_TRACE=1 if db.trace is set to true. Signed-off-by: Waleed Khalid <wak327@gmail.com>
Signed-off-by: Waleed Khalid <wak327@gmail.com>
Signed-off-by: Waleed Khalid <wak327@gmail.com>
25e972e to
77ebf75
Compare
|
@roosterfish the supported keys are now declared once in |

Fixes #806
The daemon already has a
--debugflag, but the snap gives users no way to turn it on. This PR adds two snap config options, following how the LXD snap does it:daemon.debug=truestartsmicroclouddwith--debug.db.trace=trueexportsLIBDQLITE_TRACE=1for the daemon, as requested in Allow enabling debug logging in MicroCloud #806 (comment).Changes:
snap/hooks/configure: snapd refusessnap setunless the snap has a configure hook. This hook validates that both keys are empty,trueorfalse.snapcraft/commands/daemon.start: reads both keys withsnapctl getwhen the daemon starts. The hook doesn't restart the daemon, so changes take effect aftersnap restart microcloud. The LXD snap behaves the same way.doc/how-to/snaps.md: adds an "Enable debug logging" section.Usage:
sudo snap set microcloud daemon.debug=true sudo snap restart microcloudThis affects MicroCloud's own logs, which go through the LXD logger. Microcluster's slog handler stays at its default level. Passing our level to it ties into the logger rework in #1084, so I left it out here.
Testing: I couldn't build the snap locally. I ran both scripts with stubbed
snapctlandmicroclouddbinaries to check the arguments and environment for every combination of the two keys, and to check that the hook rejects values other thantrueandfalse.Checklist