Improve startup diagnostics and systemd robustness
This commit is contained in:
parent
67fc8d1701
commit
5f756ea04e
3 changed files with 18 additions and 2 deletions
|
|
@ -125,6 +125,11 @@ systemctl --user daemon-reload
|
||||||
systemctl --user enable --now aman
|
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
|
## Usage
|
||||||
|
|
||||||
- Press the hotkey once to start recording.
|
- Press the hotkey once to start recording.
|
||||||
|
|
|
||||||
12
src/aman.py
12
src/aman.py
|
|
@ -16,7 +16,7 @@ from typing import Any
|
||||||
|
|
||||||
from aiprocess import LlamaProcessor
|
from aiprocess import LlamaProcessor
|
||||||
from config import Config, load, redacted_dict
|
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 desktop import get_desktop_adapter
|
||||||
from recorder import start_recording as start_audio_recording
|
from recorder import start_recording as start_audio_recording
|
||||||
from recorder import stop_recording as stop_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"),
|
args.config or str(Path.home() / ".config" / "aman" / "config.json"),
|
||||||
json.dumps(redacted_dict(cfg), indent=2),
|
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:
|
try:
|
||||||
desktop = get_desktop_adapter()
|
desktop = get_desktop_adapter()
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ After=default.target
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=%h/.local/share/aman
|
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
|
Restart=on-failure
|
||||||
RestartSec=2
|
RestartSec=2
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue