Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
lima-vm
GitHub Repository: lima-vm/lima
Path: blob/master/pkg/autostart/managers_linux.go
2609 views
1
// SPDX-FileCopyrightText: Copyright The Lima Authors
2
// SPDX-License-Identifier: Apache-2.0
3
4
package autostart
5
6
import "github.com/lima-vm/lima/v2/pkg/autostart/systemd"
7
8
// Manager returns the autostart manager for Linux.
9
func Manager() autoStartManager {
10
if systemd.IsRunningSystemd() {
11
return &TemplateFileBasedManager{
12
filePath: systemd.GetUnitPath,
13
template: systemd.Template,
14
enabler: systemd.EnableDisableUnit,
15
autoStartedIdentifier: systemd.AutoStartedUnitName,
16
requestStart: systemd.RequestStart,
17
requestStop: systemd.RequestStop,
18
}
19
}
20
// TODO: add support for non-systemd Linux distros
21
return &notSupportedManager{}
22
}
23
24