Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: Add db.trace snap config to set LIBDQLITE_TRACE #643

Merged
merged 1 commit into from
Dec 4, 2024
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
1 change: 1 addition & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ description: |-
- daemon.preseed: Pass a YAML configuration to `lxd init` on initial start
- daemon.syslog: Send LXD log events to syslog [default=false]
- daemon.verbose: Increase logging to verbose level [default=false]
- db.trace: Enable dqlite trace logging (very verbose) [default=false]
- lvm.external: Use the system's LVM tools [default=false]
- lxcfs.pidfd: Start per-container process tracking [default=false]
- lxcfs.loadavg: Start tracking per-container load average [default=false]
Expand Down
4 changes: 4 additions & 0 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,10 @@ if [ "${daemon_verbose:-"false"}" = "true" ]; then
CMD="${CMD} --verbose"
fi

if [ "${db_trace:-"false"}" = "true" ]; then
export LIBDQLITE_TRACE=1
fi

# Check if this is the first time LXD is started.
FIRSTRUN="false"
if [ ! -d "${SNAP_COMMON}/lxd/database" ]; then
Expand Down
2 changes: 2 additions & 0 deletions snapcraft/hooks/configure
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ daemon_group=$(snapctl get daemon.group)
daemon_user_group=$(snapctl get daemon.user.group)
daemon_syslog=$(get_bool "$(snapctl get daemon.syslog)")
daemon_verbose=$(get_bool "$(snapctl get daemon.verbose)")
db_trace=$(get_bool "$(snapctl get db.trace)")
lvm_external=$(get_bool "$(snapctl get lvm.external)")
lxcfs_loadavg=$(get_bool "$(snapctl get lxcfs.loadavg)")
lxcfs_pidfd=$(get_bool "$(snapctl get lxcfs.pidfd)")
Expand Down Expand Up @@ -80,6 +81,7 @@ daemon_group=${daemon_group:-"lxd"}
daemon_syslog=${daemon_syslog:-"false"}
daemon_user_group=${daemon_user_group:-"lxd"}
daemon_verbose=${daemon_verbose:-"false"}
db_trace=${db_trace:-"false"}
lvm_external=${lvm_external:-"false"}
lxcfs_cfs=${lxcfs_cfs:-"false"}
lxcfs_debug=${lxcfs_debug:-"false"}
Expand Down