mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
all: ensure ctrld started after mongodb on Ubios
Because ctrld needs to query custom client mapping from it. While at it, also make the error message clearer when initializing ubios discover failed, by attaching the command output to returned error.
This commit is contained in:
committed by
Cuong Manh Le
parent
3403b2039d
commit
4ebe2fb5f4
@@ -215,6 +215,20 @@ func LeaseFilesDir() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// ServiceDependencies returns list of dependencies that ctrld services needs on this router.
|
||||
// See https://pkg.go.dev/github.com/kardianos/service#Config for list format.
|
||||
func ServiceDependencies() []string {
|
||||
if Name() == ubios.Name {
|
||||
// On Ubios, ctrld needs to start after unifi-mongodb,
|
||||
// so it can query custom client info mapping.
|
||||
return []string{
|
||||
"Wants=unifi-mongodb.service",
|
||||
"After=unifi-mongodb.service",
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func distroName() string {
|
||||
switch {
|
||||
case bytes.HasPrefix(unameO(), []byte("DD-WRT")):
|
||||
|
||||
@@ -219,6 +219,8 @@ const ubiosBootSystemdService = `[Unit]
|
||||
Description=Run ctrld On Startup UDM
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
Wants=unifi-mongodb
|
||||
After=unifi-mongodb
|
||||
StartLimitIntervalSec=500
|
||||
StartLimitBurst=5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user