Skip to content

Commit

Permalink
config: Add db.trace snap config to set LIBDQLITE_TRACE
Browse files Browse the repository at this point in the history
Signed-off-by: Wesley Hershberger <[email protected]>
  • Loading branch information
MggMuggins committed Dec 3, 2024
1 parent 84e633a commit 91cf42f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
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

0 comments on commit 91cf42f

Please sign in to comment.