MCPcopy
hub / github.com/apptainer/apptainer / StageTwo

Function StageTwo

internal/app/starter/stage_linux.go:43–63  ·  view source on GitHub ↗

StageTwo performs container execution.

(masterSocket int, e *engine.Engine)

Source from the content-addressed store, hash-verified

41
42// StageTwo performs container execution.
43func StageTwo(masterSocket int, e *engine.Engine) {
44 sylog.Debugf("Entering stage 2\n")
45
46 // master socket allows communications between
47 // stage 2 and master process, typically used for
48 // synchronization or for sending state
49
50 // call engine operation StartProcess, at this stage
51 // we are in a container context, chroot was done.
52 // The privileges are those applied by the container
53 // configuration, in the case of Apptainer engine
54 // and if run as a user, there is no privileges set
55 if err := e.StartProcess(masterSocket); err != nil {
56 // write data to just tell master to not execute PostStartProcess
57 // in case of failure
58 if _, err := syscall.Write(masterSocket, []byte("f")); err != nil {
59 sylog.Errorf("fail to send data to master: %s", err)
60 }
61 sylog.Fatalf("%s\n", err)
62 }
63}

Callers

nothing calls this directly

Calls 5

DebugfFunction · 0.92
ErrorfFunction · 0.92
FatalfFunction · 0.92
StartProcessMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected