unprovision
This commit is contained in:
parent
22c2f68c2a
commit
1e53bba6e7
6 changed files with 148 additions and 0 deletions
|
|
@ -257,3 +257,20 @@ func (a *App) getServiceStatus(p Project) (ServiceStatus, error) {
|
|||
func (a *App) getServiceLogs(p Project, lines int) (string, error) {
|
||||
return runJournalctlUser(p.UnixUser, "-u", p.ServiceName, "--no-pager", "-n", strconv.Itoa(lines), "-r", "-o", "short-iso")
|
||||
}
|
||||
|
||||
func (a *App) removeSystemdForProject(p Project) error {
|
||||
homeDir, err := homeForUnixUser(p.UnixUser)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
servicePath := filepath.Join(homeDir, ".config", "systemd", "user", p.ServiceName)
|
||||
projectDir, err := a.projectDirFor(p)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = runSystemctlUser(p.UnixUser, "disable", "--now", p.ServiceName)
|
||||
_ = os.Remove(servicePath)
|
||||
_ = runSystemctlUser(p.UnixUser, "daemon-reload")
|
||||
_ = os.Remove(filepath.Join(projectDir, "app.sock"))
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue