8000 stage1: reorder iomux service by iaguis · Pull Request #3830 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

8000 stage1: reorder iomux service #3830

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions stage1/init/common/units.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func ImmutableEnv(p *stage1commontypes.Pod) error {
// 3. if any of stdin/stdout/stderr is in TTY or streaming mode:
// 3a. the env file for iottymux is written to `/rkt/iottymux/<appname>/env` with the above content
// 3b. for TTY mode, a `TTYPath` property and an `After=ttymux@<appname>.service` dependency are added
// 3c. for streaming mode, a `Before=iomux@<appname>.service` dependency is added
// 3c. for streaming mode, an `After=iomux@<appname>.service` dependency is added
//
// For complete details, see dev-docs at Documentation/devel/log-attach-design.md
func (uw *UnitWriter) SetupAppIO(p *stage1commontypes.Pod, ra *schema.RuntimeApp, binPath string, opts ...*unit.UnitOption) []*unit.UnitOption {
Expand Down Expand Up @@ -321,9 +321,9 @@ func (uw *UnitWriter) SetupAppIO(p *stage1commontypes.Pod, ra *schema.RuntimeApp
}

if needsIOMux {
// streaming mode brings in a `iomux@.service` before-dependency
// streaming mode brings in a `iomux@.service` after-dependency
opts = append(opts, unit.NewUnitOption("Unit", "Requires", fmt.Sprintf("iomux@%s.service", ra.Name)))
opts = append(opts, unit.NewUnitOption("Unit", "Before", fmt.Sprintf("iomux@%s.service", ra.Name)))
opts = append(opts, unit.NewUnitOption("Unit", "After", fmt.Sprintf("iomux@%s.service", ra.Name)))
logMode, ok := p.Manifest.Annotations.Get("coreos.com/rkt/experiment/logmode")
if ok {
file.WriteString(fmt.Sprintf("STAGE1_LOGMODE=%s\n", logMode))
Expand Down Expand Up @@ -771,6 +771,7 @@ func (uw *UnitWriter) AppSocketUnit(appName types.ACName, binPath string, stream
unit.NewUnitOption("Unit", "RefuseManualStart", "yes"),
unit.NewUnitOption("Unit", "RefuseManualStop", "yes"),
unit.NewUnitOption("Unit", "BindsTo", fmt.Sprintf("%s.service", appName)),
unit.NewUnitOption("Unit", "Before", fmt.Sprintf("iomux@%s.service", appName)),
unit.NewUnitOption("Socket", "RemoveOnStop", "yes"),
unit.NewUnitOption("Socket", "Service", fmt.Sprintf("%s.service", appName)),
unit.NewUnitOption("Socket", "FileDescriptorName", streamName),
Expand Down
0