Skip to content

Commit

Permalink
debugd: enable debug logging for systemd units (#2923)
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev authored Feb 20, 2024
1 parent 889677c commit fe85877
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion debugd/internal/debugd/deploy/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func (s *ServiceManager) OverrideServiceUnitExecStart(ctx context.Context, unitN
if strings.Contains(execStart, "\n") || strings.Contains(execStart, "\r") {
return fmt.Errorf("execStart must not contain newlines")
}
overrideUnitContents := fmt.Sprintf("[Service]\nExecStart=\nExecStart=%s\n", execStart)
overrideUnitContents := fmt.Sprintf("[Service]\nExecStart=\nExecStart=%s $CONSTELLATION_DEBUG_FLAGS\n", execStart)
s.systemdUnitFilewriteLock.Lock()
defer s.systemdUnitFilewriteLock.Unlock()
path := filepath.Join(systemdUnitFolder, unitName+".service.d", "override.conf")
Expand Down
4 changes: 2 additions & 2 deletions debugd/internal/debugd/deploy/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func TestOverrideServiceUnitExecStart(t *testing.T) {
},
unitName: "test",
execStart: "/run/state/bin/test",
wantFileContents: "[Service]\nExecStart=\nExecStart=/run/state/bin/test\n",
wantFileContents: "[Service]\nExecStart=\nExecStart=/run/state/bin/test $CONSTELLATION_DEBUG_FLAGS\n",
wantActionCalls: []dbusConnActionInput{
{name: "test.service", mode: "replace"},
},
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestOverrideServiceUnitExecStart(t *testing.T) {
},
unitName: "test",
execStart: "/run/state/bin/test",
wantFileContents: "[Service]\nExecStart=\nExecStart=/run/state/bin/test\n",
wantFileContents: "[Service]\nExecStart=\nExecStart=/run/state/bin/test $CONSTELLATION_DEBUG_FLAGS\n",
wantActionCalls: []dbusConnActionInput{
{name: "test.service", mode: "replace"},
},
Expand Down

0 comments on commit fe85877

Please sign in to comment.