mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
debugd: enable debug logging for systemd units (#2923)
This commit is contained in:
parent
889677c795
commit
fe85877679
@ -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")
|
||||
|
@ -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"},
|
||||
},
|
||||
@ -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"},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user