ids.alfacom.it/deployment/systemd/ids-ml-backend.service
marco370 7ec5ff553b Add systemd service management with API key security
Implement systemd service management for ML backend and Syslog parser with API key authentication and robust error handling across frontend and backend.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Event-Id: e0ddd146-1e7d-40e4-8607-ef8d247a1f49
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/n4Q2eeE
2025-11-22 09:33:30 +00:00

31 lines
579 B
Desktop File

[Unit]
Description=IDS ML Backend (FastAPI)
After=network.target postgresql.service
Requires=postgresql.service
[Service]
Type=simple
User=ids
Group=ids
WorkingDirectory=/opt/ids/python_ml
EnvironmentFile=/opt/ids/.env
# Comando esecuzione
ExecStart=/usr/bin/python3 main.py
# Restart automatico in caso di crash
Restart=on-failure
RestartSec=10s
# Limiti risorse
LimitNOFILE=65536
MemoryMax=2G
# Logging
StandardOutput=append:/var/log/ids/ml_backend.log
StandardError=append:/var/log/ids/ml_backend.log
SyslogIdentifier=ids-ml-backend
[Install]
WantedBy=multi-user.target