clean up corrosion systemd service

This commit is contained in:
Pavel Sviderski
2024-09-26 19:14:25 +10:00
parent 1ec3376be5
commit b25938acc1
-7
View File
@@ -11,22 +11,15 @@ const DefaultSystemdUnit = "uncloud-corrosion.service"
type SystemdService struct { type SystemdService struct {
DataDir string DataDir string
Unit string Unit string
User string
} }
func DefaultSystemdService(dataDir string) *SystemdService { func DefaultSystemdService(dataDir string) *SystemdService {
return &SystemdService{ return &SystemdService{
DataDir: dataDir, DataDir: dataDir,
Unit: DefaultSystemdUnit, Unit: DefaultSystemdUnit,
User: DefaultUser,
} }
} }
func (s *SystemdService) Configure() error {
// TODO: create config.toml and schema dir in DataDir.
return nil
}
func (s *SystemdService) Start() error { func (s *SystemdService) Start() error {
if _, err := exec.Command("systemctl", "start", s.Unit).Output(); err != nil { if _, err := exec.Command("systemctl", "start", s.Unit).Output(); err != nil {
return fmt.Errorf("systemctl start %s: %w", s.Unit, err) return fmt.Errorf("systemctl start %s: %w", s.Unit, err)