systemg

Search docs

/
Install

Commands

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

ShortLongDescription
-c--configPath to the configuration file. If not specified, systemg looks for systemg.yaml or sysg.yaml in the current directory
-s--serviceOptionally start only the named service instead of all services
-p--projectTarget a stable project id when a supervisor manages multiple projects
---nameOptional name for units or child-start units
---daemonizeRun the supervisor as a background daemon
---parent-pidRun start in child mode by attaching the process to a parent service PID
---ttlOptional time-to-live in seconds for child mode
---childExplicit child-mode marker. Requires --parent-pid
---sysOpt into privileged system mode. Requires running as root
---drop-privilegesDrop child service privileges during spawn. In root/system mode, services without an explicit user run as nobody
---stderrPipe stderr output from supervised processes to stdout in foreground mode
-v--verbosePrint per-service boot progress
---plainDisable terminal decoration and accidental log following for automation
---log-levelSet logging verbosity for this invocation. Accepts named levels (trace, debug, info, warn, error, off) or numeric values (5-0)

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 written to log files when the service uses logs.sink: file.

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

Foreground mode

Without --daemonize, the terminal attaches to the selected project. Boot progress updates in place, and output from every running service is multiplexed with a per-service prefix. Ctrl-C stops only that project and returns the terminal; the resident supervisor and other projects remain running.

Daemon mode

Start without retaining a terminal attachment. The command returns after the project reaches its target state; subsequent commands use the same resident supervisor.

$ 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 identifies the service and captured stream:

api | 2026-07-19T04:45:26Z stderr Error: Database connection failed
worker | 2026-07-19T04:45:27Z stderr Warning: Queue full, retrying...

Unit mode (no config file)

Unit mode is for ad-hoc commands you want systemg to manage without writing a project manifest first:

$ sysg start --daemonize --name db-tunnel -- sh db-tunnel.sh

systemg stages the command by translating it into a generated version 2 manifest—the common format the central supervisor understands for services and projects.

Info

With no supervisor, the staged manifest starts a supervisor and the unit runs immediately. With a resident supervisor, staging does not alter live state: no process starts until you run the explicit sysg start --config ... command printed by systemg.

See Units for the complete stage, apply, inspect, and stop workflow.

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 validates the complete graph and starts dependencies first
  2. Unit mode creates a single managed unit from the command
  3. Child mode attaches a managed child to the parent process tree
  4. Service output follows the configured logs.sink policy
  5. PIDs, process groups, lifecycle state, and cron history are tracked by project

In either mode, the supervisor owns the services. Foreground versus daemon mode controls the terminal attachment, not whether supervision exists.

Startup order

depends_on is the only thing that orders a start. Every service whose declared dependencies have resolved starts at the same time, so a boot takes as long as its longest dependency chain rather than the sum of every service's readiness wait. A service never waits on one it did not declare.

Set start.max_concurrent in supervisor.xml to 1 to start services one at a time, or to a positive number to cap how many run at once. The cap is worth reaching for when a wide boot contends for something the supervisor cannot see — every service opening connections to the same database at the same moment.

See also

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