apply_nosystemd.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // +build !linux
  2. package systemd
  3. import (
  4. "fmt"
  5. "github.com/opencontainers/runc/libcontainer/cgroups"
  6. "github.com/opencontainers/runc/libcontainer/configs"
  7. )
  8. type Manager struct {
  9. Cgroups *configs.Cgroup
  10. Paths map[string]string
  11. }
  12. func UseSystemd() bool {
  13. return false
  14. }
  15. func (m *Manager) Apply(pid int) error {
  16. return fmt.Errorf("Systemd not supported")
  17. }
  18. func (m *Manager) GetPids() ([]int, error) {
  19. return nil, fmt.Errorf("Systemd not supported")
  20. }
  21. func (m *Manager) GetAllPids() ([]int, error) {
  22. return nil, fmt.Errorf("Systemd not supported")
  23. }
  24. func (m *Manager) Destroy() error {
  25. return fmt.Errorf("Systemd not supported")
  26. }
  27. func (m *Manager) GetPaths() map[string]string {
  28. return nil
  29. }
  30. func (m *Manager) GetStats() (*cgroups.Stats, error) {
  31. return nil, fmt.Errorf("Systemd not supported")
  32. }
  33. func (m *Manager) Set(container *configs.Config) error {
  34. return nil, fmt.Errorf("Systemd not supported")
  35. }
  36. func (m *Manager) Freeze(state configs.FreezerState) error {
  37. return fmt.Errorf("Systemd not supported")
  38. }
  39. func Freeze(c *configs.Cgroup, state configs.FreezerState) error {
  40. return fmt.Errorf("Systemd not supported")
  41. }