mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
internal/router: remove ctrld-boot service when uninstall
This commit is contained in:
committed by
Cuong Manh Le
parent
ccdb2a3f70
commit
6c55d8f139
@@ -131,6 +131,23 @@ func (s *ubiosSvc) Uninstall() error {
|
||||
if err := os.Remove(s.configPath()); err != nil {
|
||||
return err
|
||||
}
|
||||
// Remove ctrld-boot service inside unifi-os container.
|
||||
cmd := exec.Command("podman", "exec", "unifi-os", "systemctl", "disable", "ctrld-boot.service")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to disable ctrld-boot service, out: %s, err: %v", string(out), err)
|
||||
}
|
||||
cmd = exec.Command("podman", "exec", "unifi-os", "rm", "/lib/systemd/system/ctrld-boot.service")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to remove ctrld-boot service file, out: %s, err: %v", string(out), err)
|
||||
}
|
||||
cmd = exec.Command("podman", "exec", "unifi-os", "systemctl", "daemon-reload")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to reload systemd service, out: %s, err: %v", string(out), err)
|
||||
}
|
||||
cmd = exec.Command("podman", "exec", "unifi-os", "systemctl", "reset-failed")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
return fmt.Errorf("failed to reset-failed systemd service, out: %s, err: %v", string(out), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user