> ## Documentation Index
> Fetch the complete documentation index at: https://sysg.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# State

# State

Runtime files systemg uses to track services.

## Location

`~/.local/share/systemg/` (user mode)
`/var/lib/systemg/` (system mode with `--sys`)

## Structure

```
~/.local/share/systemg/
├── sysg.pid           # Supervisor PID
├── control.sock       # Unix socket for IPC
├── config_hint        # Last config path
├── pid.xml           # Service → PID mapping
├── state.xml         # Service metadata
└── logs/             # Service output
```

## Key files

### pid.xml

Maps services to process IDs:

```xml theme={null}
<PidFile>
  <services>
    <web>67235</web>
    <db>67236</db>
  </services>
</PidFile>
```

### config\_hint

Stores the last config path for commands that need a config-backed project
context. `sysg status` does not require this hint when a supervisor is running;
it asks the supervisor for the aggregate status view.

### state.xml

Tracks service status, restart counts, and exit codes.

## Persistence

State survives supervisor restarts. Services keep running even if the supervisor crashes.

Clean shutdown removes `sysg.pid` and `control.sock`. Stale files after crash? Run `sysg purge`.

## See also

* [`purge`](/how-it-works/commands/purge) - Clear all state
* [How It Works](/how-it-works) - Architecture overview
