Skip to content

Commit

Permalink
config: Add db.trace snap config to set LIBDQLITE_TRACE (#643)
Browse files Browse the repository at this point in the history
This may be useful when troubleshooting dqlite issues, esp. for
customers. Had trouble building locally so wanted to try CI.
  • Loading branch information
tomponline authored Dec 4, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 84e633a + 91cf42f commit 0b6e8e9
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
@@ -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]
4 changes: 4 additions & 0 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions snapcraft/hooks/configure
Original file line number Diff line number Diff line change
@@ -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)")
@@ -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"}

0 comments on commit 0b6e8e9

Please sign in to comment.