From f6ad21078597c7f6900138e0b76ec8fb68fce6f1 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Mon, 8 Jun 2015 15:06:05 -0700 Subject: [PATCH] Stop systemd unit on destroy It totally fixes leftover ".scope" fails. Of course it's just workaround, real issue seems to be in go-systemd library or in systemd itself. Signed-off-by: Alexander Morozov --- cgroups/systemd/apply_systemd.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cgroups/systemd/apply_systemd.go b/cgroups/systemd/apply_systemd.go index 98e9a5d38..1251447a7 100644 --- a/cgroups/systemd/apply_systemd.go +++ b/cgroups/systemd/apply_systemd.go @@ -259,6 +259,7 @@ func (m *Manager) Apply(pid int) error { func (m *Manager) Destroy() error { m.mu.Lock() defer m.mu.Unlock() + theConn.StopUnit(getUnitName(m.Cgroups), "replace") if err := cgroups.RemovePaths(m.Paths); err != nil { return err }