This document explains how to restart the NIJA trading bot.
NIJA provides two methods for restarting the bot:
Both methods perform a graceful shutdown by sending a SIGTERM signal to the bot process, allowing it to close positions and clean up resources before the deployment platform automatically restarts it.
POST /api/restart
curl -X POST http://localhost:5001/api/restart
{
"success": true,
"message": "Restart signal sent to NIJA bot",
"pid": 12345,
"timestamp": "2026-01-21T20:45:00.000Z"
}
{
"success": false,
"message": "Bot process not found - it may not be running",
"timestamp": "2026-01-21T20:45:00.000Z"
}
{
"success": false,
"error": "Error message here",
"timestamp": "2026-01-21T20:45:00.000Z"
}
./restart_nija.sh
==============================
RESTARTING NIJA TRADING BOT
==============================
Found NIJA bot process: PID 12345
Sending SIGTERM signal for graceful shutdown...
✅ Restart signal sent
The deployment platform will automatically restart the bot
To check if the bot restarted successfully:
tail -f nija.log
bot.py processbot.py line 135-137):
ON_FAILURE with max 10 retries (see railway.json)--restart=unless-stopped), the container will be restarted automaticallyRestart the bot when you need to:
.env fileAfter triggering a restart, monitor the bot logs:
# Watch live logs
tail -f nija.log
# Check recent logs
tail -100 nija.log
Look for the startup banner:
======================================================================
NIJA TRADING BOT - APEX v7.1
Branch: main
Commit: abc1234
======================================================================
This means the bot is not currently running. Start it with:
./start.sh
Check your deployment platform’s restart policy configuration:
railway.json for restartPolicyTypeThe bot may be waiting for:
Give it 30-60 seconds before checking the logs.
The /api/restart endpoint should be protected in production environments:
/bot/dashboard_server.py - Contains the /api/restart endpoint implementation/restart_nija.sh - Command-line restart script/bot.py - Main bot entry point with signal handlers/start.sh - Bot startup script