Skip to content

Commit

Permalink
fix systemd process manager
Browse files Browse the repository at this point in the history
  • Loading branch information
et-nik committed Apr 21, 2024
1 parent 867b416 commit d67f8ff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/processmanager/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func (pm *SystemD) SendInput(
}

func (pm *SystemD) makeService(ctx context.Context, server *domain.Server) error {
f, err := os.OpenFile(pm.serviceFile(server), os.O_CREATE|os.O_WRONLY, 0644)
f, err := os.OpenFile(pm.serviceFile(server), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
return errors.WithMessage(err, "failed to open file")
}
Expand Down Expand Up @@ -350,11 +350,11 @@ func (pm *SystemD) buildServiceConfig(server *domain.Server) (string, error) {

logFile := pm.logFile(server)

builder.WriteString("StandardOutput=file:")
builder.WriteString("StandardOutput=append:")
builder.WriteString(logFile)
builder.WriteString("\n")

builder.WriteString("StandardError=file:")
builder.WriteString("StandardError=append:")
builder.WriteString(logFile)
builder.WriteString("\n")

Expand Down Expand Up @@ -431,6 +431,7 @@ func (pm *SystemD) buildSocketConfig(server *domain.Server) string {
return builder.String()
}

// Full path to log file

Check failure on line 434 in internal/processmanager/systemd.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

Comment should end in a period (godot)
func (pm *SystemD) logFile(server *domain.Server) string {
builder := strings.Builder{}
builder.Grow(100)
Expand All @@ -445,6 +446,7 @@ func (pm *SystemD) logFile(server *domain.Server) string {
return builder.String()
}

// Full path to stdin file

Check failure on line 449 in internal/processmanager/systemd.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

Comment should end in a period (godot)
func (pm *SystemD) stdinFile(server *domain.Server) string {
builder := strings.Builder{}
builder.Grow(100)
Expand Down

0 comments on commit d67f8ff

Please sign in to comment.