systemg

Search docs

/
Install

Commands

stop

Stop services for a project, service, or the entire supervisor.

$ sysg stop

Options

ShortLongDescription
-c--configPath to the configuration file. When a supervisor is running, systemg uses it to resolve the target project. Without a supervisor, systemg uses it to locate persisted service state
-s--serviceName of a specific service to stop. If not specified, all services are stopped
-p--projectTarget a stable project id when stopping services
---supervisorShut down the resident supervisor and all registered projects
-v--verbosePrint per-service operation progress
---sysOpt into privileged system mode. Requires running as root
---drop-privilegesAccepted globally but ignored; stop does not spawn services
---plainDisable terminal decoration for automation
---log-levelSet logging verbosity for this invocation. Accepts named levels (trace, debug, info, warn, error, off) or numeric values (5-0)

Examples

Stop the current project

$ sysg stop

By default, stop is project-scoped. It resolves the current config context and stops the services for that project.

Stop a project from a config

$ sysg stop --config ./systemg.yaml

Stop a registered project

$ sysg stop --project arbitration

Stop a specific service

$ sysg stop --service api

Leaves other services running.

For multi-project supervisors, combine project and service selectors:

$ sysg stop --project arbitration --service api

Shut down the supervisor

$ sysg stop --supervisor

This stops every registered project and exits the resident supervisor. After this, plain sysg status reports No running supervisor.

What happens

  1. Services stop in reverse dependency order
  2. Each service receives SIGTERMthe whole tree, not just the named process
  3. After a short grace period (about 1 second), SIGKILL is sent if needed
  4. The supervisor remains available unless you used --supervisor

Info

Descendants are included. Every service leads its own session, so a stop sweeps the union of the service's descendants, its process group and its session — a forked shell, a browser's renderers, a worker pool. A stop reports success only when nothing from the unit is left alive. Dynamically spawned children are reclaimed too, subject to their termination_policy. Process trees has the full mechanism.

When stopping a single service manually, its dependents keep running — an operator stopping one unit is a decision, not a failure. A dependency that crashes or fails its health check does stop its dependents; once it is healthy again the supervisor starts the eligible ones back up. See dependency failure.

Reloading a manifest after stop

Stopping a project does not freeze its old unit definitions. Running sysg stop --project <id> followed by sysg start --config <file> reloads the project from the supplied config, so manifest changes (added or removed services, changed commands) are applied on the next start. To reload in place without a stop, use restart --project <id>, which reuses the project's stored config path.

See also

startrestart