diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-03 20:46:41 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-03 21:16:45 +0900 |
| commit | c6be82bcf91fc4b6e61d9df40213e80367addbd8 (patch) | |
| tree | ee245cf214ff845f0d8a3eac0cc1a6064107112d /container/container.go | |
| parent | 38245559dca0833dc078b982d59490eee53e168c (diff) | |
container/path: fhs path constants
This increases readability since this can help disambiguate absolute paths from similarly named path segments.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container.go')
| -rw-r--r-- | container/container.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/container/container.go b/container/container.go index efbfc210..5a7858f1 100644 --- a/container/container.go +++ b/container/container.go @@ -18,10 +18,6 @@ import ( ) const ( - // Nonexistent is a path that cannot exist. - // /proc is chosen because a system with covered /proc is unsupported by this package. - Nonexistent = "/proc/nonexistent" - // CancelSignal is the signal expected by container init on context cancel. // A custom [Container.Cancel] function must eventually deliver this signal. CancelSignal = SIGTERM @@ -142,7 +138,7 @@ func (p *Container) Start() error { } else { p.cmd.Cancel = func() error { return p.cmd.Process.Signal(CancelSignal) } } - p.cmd.Dir = "/" + p.cmd.Dir = FHSRoot p.cmd.SysProcAttr = &SysProcAttr{ Setsid: !p.RetainSession, Pdeathsig: SIGKILL, @@ -251,6 +247,6 @@ func (p *Container) ProcessState() *os.ProcessState { func New(ctx context.Context, name string, args ...string) *Container { return &Container{name: name, ctx: ctx, - Params: Params{Args: append([]string{name}, args...), Dir: "/", Ops: new(Ops)}, + Params: Params{Args: append([]string{name}, args...), Dir: FHSRoot, Ops: new(Ops)}, } } |
