con un clic
server-access
SSH access to AMC servers and debugging amc-backend services
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
SSH access to AMC servers and debugging amc-backend services
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
| name | server-access |
| description | SSH access to AMC servers and debugging amc-backend services |
Both servers require Tailscale for SSH.
ssh root@asean-mt-server # Main server (game + backend)
ssh root@amc-peripheral # Peripheral server (radio, bots)
The amc-backend runs directly on asean-mt-server as host-level systemd services.
systemctl status amc-worker
systemctl status amc-backend
systemctl status postgresql
journalctl -u amc-worker -n 100 --no-pager
journalctl -u amc-worker --since '1 hour ago' --no-pager
systemctl restart amc-worker
systemctl restart amc-backend
Use the amcm wrapper (available to root):
amcm <command>
For example:
amcm shell
amcm migrate
amcm backfill_vehicle_stats --sleep 0.1
Or manually:
su -s /bin/sh amc -c \
'DJANGO_SETTINGS_MODULE=amc_backend.settings amc-manage <command>'
For shell queries:
su -s /bin/sh amc -c \
'DJANGO_SETTINGS_MODULE=amc_backend.settings amc-manage shell -c "<python code>"'
[!IMPORTANT] Django commands must run as the
amcuser and requireDJANGO_SETTINGS_MODULE=amc_backend.settings.
su -s /bin/sh amc -c 'psql'
| Service | systemd unit | Description |
|---|---|---|
| Django API | amc-backend | uvicorn ASGI server |
| Worker + Discord Bot | amc-worker | arq worker with Discord bot in a ThreadPoolExecutor |
| Dummy Server | dummy-server | Test/dummy server |
| PostgreSQL | postgresql | Database with PostGIS, TimescaleDB, pg_partman |
| Redis | redis-amc-backend | Task queue and caching |
| Log Listener | rsyslogd | RELP log ingestion from game servers |
The amc-worker process runs arq which:
aiohttp session pool and starts the Discord bot in a ThreadPoolExecutormonitor_jobs, monitor_webhook, monitor_locations, send_event_embeds, etc.process_log_line tasks from RedisJobsCog, EventsCog, RoleplayCog, etc.) with their own tasks.loop schedules[!CAUTION] The Discord bot runs in a separate thread inside the arq worker. If the bot crashes or a cog's
tasks.loopdies from an unhandled exception, the arq worker process will continue running normally — only the bot/cog functionality stops silently. Check for both arq cron output AND Discord-specific logs when debugging.
motortown-server — Main Motor Town game servermotortown-server-containers-test — Test game server containermotortown-server-containers-event — Event game server containeramc-worker is running: systemctl status amc-workerjournalctl -u amc-worker --since '1 hour ago' | grep -i "<loop_name>"journalctl -u amc-worker --since '3 days ago' | grep -i "discord.*error\|DiscordServerError\|Traceback"tasks.loop died, restart the worker: systemctl restart amc-worker[!NOTE] The pre-push git hook only runs ruff (fast linting). Pytest must be run manually before pushing.
Tests require a local PostgreSQL instance. The .envrc in amc-backend/ starts one automatically via layout_postgres.
cd amc-server/amc-backend
direnv exec . python -m pytest <path-to-test-file> -x -q
Key points:
direnv exec . — it loads PGHOST, PGDATA, and DJANGO_SETTINGS_MODULE from .envrc + the Nix dev shell. Running pytest directly (without direnv) will fail with "settings not configured" or "cannot connect to database".--ds=amc_backend.settings manually; DJANGO_SETTINGS_MODULE is already set by .envrc..direnv/postgres/. Tests create and tear down their own schema.Example:
direnv exec . python -m pytest src/amc/test_auction_api.py src/amc/test_auction_escrow.py -x -q
Tests use SQLite in-memory — no database required:
cd amc-server/amc-peripheral
direnv exec . pytest tests/ -q
Building, packaging, and deploying MTDediMod releases (server and client mods)
Debugging crash dumps, PDB symbols, and UE4SS Lua GC issues in MTDediMod
Managing ragenix-encrypted secrets in the AMC monorepo