StageTwo performs container execution.
(masterSocket int, e *engine.Engine)
| 41 | |
| 42 | // StageTwo performs container execution. |
| 43 | func 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 | } |
nothing calls this directly
no test coverage detected