Commands
spawn
Dynamically create child processes from parent services.
Deprecated
sysg spawn is deprecated. Use sysg start --parent-pid <pid> --name <name> -- <command...>.
$ sysg spawn --name worker_1 -- python worker.py
Options
| Short | Long | Description |
|---|---|---|
- | --name | Required. Unique identifier for spawned process |
- | --ttl | Time-to-live in seconds (optional) |
- | --parent-pid | Parent process ID (defaults to caller's parent PID if not specified) |
-v | --verbose | Print operation progress |
- | --sys | Opt into privileged system mode. Requires running as root |
- | --drop-privileges | Accepted globally but ignored by deprecated spawn; use child-mode start |
- | --plain | Disable terminal decoration for automation |
- | --log-level | Set logging verbosity for this invocation |
Examples
Preferred replacement with start
$ sysg start --parent-pid 12345 --name worker_1 -- python worker.py
$ 12345 # Returns PID
Spawn a worker process
$ sysg spawn --name worker_1 -- python worker.py
$ 12345 # Returns PID
Spawn with time limit
Process automatically terminates after 1 hour:
$ sysg spawn --name temp_worker \
--ttl 3600 \
-- ./process.sh
Spawn with parent PID tracking
$ sysg spawn --name api_worker \
--parent-pid 12345 \
-- node worker.js
Requirements
Info
The parent service must opt into dynamic spawning before it can create
children. Without spawn: mode: dynamic, spawn requests from that process are
rejected because SystemG has no authorized spawn tree for the parent.
Parent service must be configured with:
services:
orchestrator:
command: "porki --role orchestrator --instructions instructions/INSTRUCTIONS.md"
spawn:
mode: dynamic
limits:
children: 10
depth: 3
descendants: 50
The parent can then spawn child processes dynamically within those limits.
See also
- Spawn configuration
status- View spawned processes