mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-25 23:30:41 +01:00
cmd/ctrld: fix systemd dependencies config
See https://github.com/systemd/systemd/issues/22360
This commit is contained in:
committed by
Cuong Manh Le
parent
851f9b9742
commit
beca95d5b9
@@ -186,11 +186,7 @@ func initCLI() {
|
||||
if os.Args[1] == "service" {
|
||||
osArgs = os.Args[3:]
|
||||
}
|
||||
if runtime.GOOS == "linux" {
|
||||
sc.Dependencies = []string{
|
||||
"After=NetworkManager-wait-online.service",
|
||||
}
|
||||
}
|
||||
setDependencies(sc)
|
||||
sc.Arguments = append([]string{"run"}, osArgs...)
|
||||
if dir, err := os.UserHomeDir(); err == nil {
|
||||
// WorkingDirectory is not supported on Windows.
|
||||
|
||||
@@ -9,3 +9,12 @@ func (p *prog) preRun() {
|
||||
p.setDNS()
|
||||
}
|
||||
}
|
||||
|
||||
func setDependencies(svc *service.Config) {
|
||||
svc.Dependencies = []string{
|
||||
"Wants=network-online.target",
|
||||
"After=network-online.target",
|
||||
"Wants=NetworkManager-wait-online.service",
|
||||
"After=NetworkManager-wait-online.service",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,8 @@
|
||||
|
||||
package main
|
||||
|
||||
import "github.com/kardianos/service"
|
||||
|
||||
func (p *prog) preRun() {}
|
||||
|
||||
func setDependencies(svc *service.Config) {}
|
||||
|
||||
Reference in New Issue
Block a user