2026-06-26 17:28:07 -04:00
|
|
|
# ProcessSettings
|
|
|
|
|
|
|
|
|
|
Configures a process before start.
|
|
|
|
|
|
|
|
|
|
```csharp
|
|
|
|
|
public sealed class ProcessSettings
|
|
|
|
|
{
|
|
|
|
|
public string WorkingDirectory { get; set; }
|
|
|
|
|
public IList<string> CommandLine { get; set; }
|
|
|
|
|
public IDictionary<string, string> EnvironmentVariables { get; set; }
|
|
|
|
|
public ProcessOutputMode OutputMode { get; set; }
|
2026-09-24 17:04:37 -07:00
|
|
|
public bool EnableStandardInput { get; set; }
|
2026-06-26 17:28:07 -04:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Notes:
|
2026-06-28 06:43:01 -07:00
|
|
|
|
2026-06-26 17:28:07 -04:00
|
|
|
- `CommandLine` must be non-empty before calling `Process.Start()`.
|
|
|
|
|
- The init process is started by `Container.Start()`, not by `Process.Start()`.
|
|
|
|
|
- `OutputMode.Event` enables `OutputReceived` / `ErrorReceived`.
|
|
|
|
|
- `OutputMode.Stream` enables `GetOutputStream(...)`.
|
2026-09-25 15:22:46 -07:00
|
|
|
- `EnableStandardInput` defaults to `false`. Must be set before `Process.Start()` or `Session.CreateContainer()` to have effect.
|
2026-06-26 17:28:07 -04:00
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
|
|
```csharp
|
|
|
|
|
var processSettings = new ProcessSettings
|
|
|
|
|
{
|
|
|
|
|
WorkingDirectory = "/workspace",
|
|
|
|
|
CommandLine = new List<string> { "/bin/sh", "-c", "env | sort" },
|
|
|
|
|
EnvironmentVariables = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
["DEMO"] = "1",
|
|
|
|
|
["PATH"] = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
|
},
|
|
|
|
|
OutputMode = ProcessOutputMode.Event
|
|
|
|
|
};
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|