MCPcopy
hub / github.com/lxc/incus / Daemon

Struct Daemon

cmd/incusd/daemon.go:86–178  ·  view source on GitHub ↗

A Daemon can respond to requests from a shared client.

Source from the content-addressed store, hash-verified

84
85// A Daemon can respond to requests from a shared client.
86type Daemon struct {
87 clientCerts *certificate.Cache
88 os *sys.OS
89 db *db.DB
90 firewall firewall.Firewall
91 bgp *bgp.Server
92 dns *dns.Server
93
94 // Event servers
95 devIncusEvents *events.DevIncusServer
96 events *events.Server
97 internalListener *events.InternalListener
98
99 // Tasks registry for long-running background tasks
100 // Keep clustering tasks separate as they cause a lot of CPU wakeups
101 tasks task.Group
102 clusterTasks task.Group
103
104 // Indexes of tasks that need to be reset when their execution interval changes
105 taskPruneImages *task.Task
106 taskClusterHeartbeat *task.Task
107
108 // Stores startup time of daemon
109 startTime time.Time
110
111 // Whether daemon was started by systemd socket activation.
112 systemdSocketActivated bool
113
114 config *DaemonConfig
115 endpoints *endpoints.Endpoints
116 gateway *cluster.Gateway
117 seccomp *seccomp.Server
118
119 proxy func(req *http.Request) (*url.URL, error)
120
121 oidcVerifier *oidc.Verifier
122
123 // Stores last heartbeat node information to detect node changes.
124 lastNodeList *cluster.APIHeartbeat
125
126 // Serialize changes to cluster membership (joins, leaves, role
127 // changes).
128 clusterMembershipMutex sync.RWMutex
129
130 serverCert func() *localtls.CertInfo
131 serverCertInt *localtls.CertInfo // Do not use this directly, use servertCert func.
132
133 // Status control.
134 setupChan chan struct{} // Closed when basic Daemon setup is completed
135 waitReady *cancel.Canceller // Cancelled when fully ready
136 shutdownCtx context.Context // Cancelled when shutdown starts.
137 shutdownCancel context.CancelFunc // Cancels the shutdownCtx to indicate shutdown starting.
138 shutdownDoneCh chan error // Receives the result of the d.Stop() function and tells the daemon to end.
139
140 // Device monitor for watching filesystem events
141 devmonitor fsmonitor.FSMonitor
142
143 // Keep track of skews.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected