{"record":{"id":"1da68ec13206df97","repo":"kubernetes/kops","slug":"error-doing-systemd-daemon-reload-v-output-s","errorCode":null,"errorMessage":"error doing systemd daemon-reload: %v\nOutput: %s","messagePattern":"error doing systemd daemon-reload: (.+?)\nOutput: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/nodeup/nodetasks/service.go","lineNumber":335,"sourceCode":"\t\tif fi.ValueOf(e.Running) {\n\t\t\taction = \"restart\"\n\t\t} else {\n\t\t\taction = \"stop\"\n\t\t}\n\t}\n\n\tif changes.Definition != nil {\n\t\tservicePath := path.Join(systemdSystemPath, serviceName)\n\t\terr := fi.WriteFile(servicePath, fi.NewStringResource(*e.Definition), 0o644, 0o755, \"\", \"\")\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error writing systemd service file: %v\", err)\n\t\t}\n\n\t\tklog.Infof(\"Reloading systemd configuration\")\n\t\tcmd := exec.Command(\"systemctl\", \"daemon-reload\")\n\t\toutput, err := cmd.CombinedOutput()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error doing systemd daemon-reload: %v\\nOutput: %s\", err, output)\n\t\t}\n\t}\n\n\t// \"SmartRestart\" - look at the obvious dependencies in the systemd service, restart if start time older\n\tif fi.ValueOf(e.ManageState) && fi.ValueOf(e.SmartRestart) {\n\t\tdefinition := fi.ValueOf(e.Definition)\n\t\tif definition == \"\" && a != nil {\n\t\t\tdefinition = fi.ValueOf(a.Definition)\n\t\t}\n\n\t\tif action == \"\" && fi.ValueOf(e.Running) && definition != \"\" {\n\t\t\tdependencies, err := getSystemdDependencies(serviceName, definition)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\t// Include the systemd unit file itself\n\t\t\tdependencies = append(dependencies, path.Join(systemdSystemPath, serviceName))","sourceCodeStart":317,"sourceCodeEnd":353,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/nodeup/nodetasks/service.go#L317-L353","documentation":"After writing a changed unit definition, RenderLocal runs `systemctl daemon-reload` so systemd picks up the new file. Any non-zero exit from systemctl (with its combined stdout/stderr attached) becomes this error, meaning the node's systemd refused or could not perform the reload.","triggerScenarios":"exec.Command(\"systemctl\", \"daemon-reload\").CombinedOutput() returns err — systemctl binary missing, systemd not running as PID 1 (e.g. in a container), dbus not reachable, or a broken unit file elsewhere causing reload validation failure.","commonSituations":"Running nodeup inside a container/CI without systemd, a hosed dbus/systemd after partial upgrades, or another malformed unit on the node making daemon-reload fail.","solutions":["Confirm systemd is PID 1 on the node (nodeup must run on a real host, not a container): ps -p 1","Run `systemctl daemon-reload` manually to see the underlying unit validation error and fix the offending unit","Verify /bin/systemctl exists and works on the image","Check dbus: systemctl failed with 'Failed to connect to bus' usually means systemd/dbus is down; reboot the node"],"exampleFix":"// diagnostic\n$ systemctl daemon-reload\nFailed to start ... /etc/systemd/system/broken.service:9\n// after: fix broken.service syntax, then re-run nodeup","handlingStrategy":"retry","validationCode":"// Verify systemd is operational before nodeup:\nsudo systemctl is-system-running || echo 'systemd degraded/not running'\nps -p 1 -o comm=   # must be systemd","typeGuard":null,"tryCatchPattern":"if err := task.RenderLocal(...); err != nil {\n\tif strings.Contains(err.Error(), \"daemon-reload\") {\n\t\t// log attached Output, fix offending unit, retry after recovery\n\t\treturn fmt.Errorf(\"systemd reload failed; inspect node systemd/dbus: %w\", err)\n\t}\n\treturn err\n}\n// Prefer bounded retry once systemd is healthy again","preventionTips":["Only run nodeup on hosts where systemd is PID 1","Validate all units with systemd-analyze verify before reload","Keep dbus/systemd healthy; reboot degraded nodes","Don't run nodeup inside containers without systemd"],"tags":["nodeup","systemd","daemon-reload","exec"],"backgroundTag":"systemctl-command-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}