Skip to main content

start

Launch managed processes in one of three modes:
  • manifest services (sysg start)
  • units (sysg start <command...>)
  • child units (sysg start --child --parent-pid <pid> -- <command...>)
$ sysg start

Options

--config

Path to the configuration file. If not specified, systemg looks for systemg.yaml or sysg.yaml in the current directory.
$ sysg start --config /etc/myapp/services.yaml

--service

Optionally start only the named service instead of all services.
$ sysg start --service api

--name

Optional name for units or child-start units.
$ sysg start --name cleanup -- ./cleanup.sh

--daemonize

Run the supervisor as a background daemon. The supervisor continues running after you close your terminal, and subsequent commands communicate with it via Unix socket.
$ sysg start --daemonize

--parent-pid

Run start in child mode by attaching the process to a parent service PID.
$ sysg start --parent-pid 4242 --name worker-1 -- python worker.py

--ttl

Optional time-to-live in seconds for child mode.
$ sysg start --parent-pid 4242 --ttl 300 --name temp-worker -- ./job.sh

--child

Explicit child-mode marker. Requires --parent-pid.
$ sysg start --child --parent-pid 4242 --name worker-1 -- python worker.py

--sys

Opt into privileged system mode. Requires running as root.
$ sudo sysg start --sys

--drop-privileges

Drop child service privileges during spawn. When enabled in root/system mode, services without an explicit user run as nobody.
$ sudo sysg start --sys --drop-privileges

--stderr

Pipe stderr output from supervised processes to stdout. In foreground mode, stderr from all services is redirected to stdout with [service_name:stderr] prefix.
$ sysg start --stderr
:::info The --stderr flag is particularly useful for:
  • Development: See error output immediately while debugging
  • CI/CD Pipelines: Capture all output in a single stream
  • Real-time Monitoring: Watch for errors as they happen
Note: This flag only affects foreground mode. In daemonized mode, stderr is still written to log files in ~/.local/share/systemg/logs/. :::

--log-level

Set logging verbosity for this invocation. Accepts named levels (trace, debug, info, warn, error, off) or numeric values (5-0).
$ sysg start --log-level debug

Examples

Start with default configuration

$ sysg start
Looks for systemg.yaml or sysg.yaml in the current directory.

Start with specific configuration

$ sysg start --config /etc/myapp/services.yaml

Daemon mode

Run the supervisor in the background. Subsequent commands communicate with this long-lived process.
$ sysg start --daemonize
Check if the daemon is running:
$ sysg status

Debug mode

See detailed output during startup:
$ sysg start --log-level debug

Capture stderr in foreground

Useful for development and debugging:
$ sysg start --stderr
Output will show stderr lines with service prefix:
[api:stderr] Error: Database connection failed
[worker:stderr] Warning: Queue full, retrying...

Unit mode (no config file)

$ sysg start --daemonize -- sleep 30
If the supervisor is already running, this command stages a unit config in ~/.local/share/systemg/units/ and prints an explicit restart command. It does not restart the supervisor implicitly.

Child mode for orchestrators (replacement for spawn)

$ sysg start --parent-pid 4242 --name worker-1 --ttl 900 -- python worker.py

What happens

  1. Manifest mode starts services in dependency order
  2. Unit mode creates a single managed unit from the command
  3. Child mode attaches a managed child to the parent process tree
  4. Logs are written to ~/.local/share/systemg/logs/
  5. PIDs are tracked for other commands
In daemon mode, the supervisor monitors services and handles restarts according to your configuration.

See also

  • stop - Stop running services
  • status - Check service health
  • restart - Restart services