Improve startup diagnostics and systemd robustness

This commit is contained in:
Thales Maciel 2026-02-26 16:31:34 -03:00
parent 67fc8d1701
commit 5f756ea04e
3 changed files with 18 additions and 2 deletions

View file

@ -125,6 +125,11 @@ systemctl --user daemon-reload
systemctl --user enable --now aman
```
Service notes:
- The user unit launches `uv` via `/usr/bin/env`; ensure `uv` is available in your user `PATH` (for example `~/.local/bin`).
- Inspect failures with `systemctl --user status aman` and `journalctl --user -u aman -f`.
## Usage
- Press the hotkey once to start recording.

View file

@ -16,7 +16,7 @@ from typing import Any
from aiprocess import LlamaProcessor
from config import Config, load, redacted_dict
from constants import RECORD_TIMEOUT_SEC, STT_LANGUAGE
from constants import MODEL_PATH, RECORD_TIMEOUT_SEC, STT_LANGUAGE
from desktop import get_desktop_adapter
from recorder import start_recording as start_audio_recording
from recorder import stop_recording as stop_audio_recording
@ -386,6 +386,16 @@ def main():
args.config or str(Path.home() / ".config" / "aman" / "config.json"),
json.dumps(redacted_dict(cfg), indent=2),
)
logging.info(
"runtime: pid=%s session=%s display=%s wayland_display=%s verbose=%s dry_run=%s",
os.getpid(),
os.getenv("XDG_SESSION_TYPE", ""),
os.getenv("DISPLAY", ""),
os.getenv("WAYLAND_DISPLAY", ""),
args.verbose,
args.dry_run,
)
logging.info("model cache path: %s", MODEL_PATH)
try:
desktop = get_desktop_adapter()

View file

@ -5,7 +5,8 @@ After=default.target
[Service]
Type=simple
WorkingDirectory=%h/.local/share/aman
ExecStart=/usr/bin/uv run python3 %h/.local/share/aman/src/aman.py --config %h/.config/aman/config.json
Environment=PATH=%h/.local/bin:/usr/local/bin:/usr/bin:/bin
ExecStart=/usr/bin/env uv run python3 %h/.local/share/aman/src/aman.py --config %h/.config/aman/config.json
Restart=on-failure
RestartSec=2