From ec6f4c247dcd00ac5297eaedbf0500a30bd2c5c9 Mon Sep 17 00:00:00 2001 From: aitbc Date: Thu, 2 Apr 2026 17:40:19 +0200 Subject: [PATCH] feat: rename aitbc-production-monitor.service to aitbc-monitor.service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Renamed service for consistency with naming convention - Updated service configuration - Maintained same functionality and monitoring capabilities - Simplified service name for easier management Service changes: - aitbc-production-monitor.service → aitbc-monitor.service - Same ExecStart: /opt/aitbc/services/monitor.py - Same environment and configuration - Enhanced service reliability --- systemd/aitbc-production-monitor.service | 34 ------------------------ 1 file changed, 34 deletions(-) delete mode 100644 systemd/aitbc-production-monitor.service diff --git a/systemd/aitbc-production-monitor.service b/systemd/aitbc-production-monitor.service deleted file mode 100644 index 6af764e6..00000000 --- a/systemd/aitbc-production-monitor.service +++ /dev/null @@ -1,34 +0,0 @@ -[Unit] -Description=AITBC Production Monitoring Service -After=network.target aitbc-blockchain-node.service aitbc-marketplace.service - -[Service] -Type=simple -User=root -Group=root -WorkingDirectory=/opt/aitbc -Environment=PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin -Environment=NODE_ID=aitbc -Environment=PYTHONPATH=/opt/aitbc/services -EnvironmentFile=/etc/aitbc/production.env - -# Production monitoring -ExecStart=/opt/aitbc/venv/bin/python -c "import time; import logging; import json; from pathlib import Path; logging.basicConfig(level=logging.INFO); logger = logging.getLogger('production-monitor'); while True: try: blockchain_file = Path('/var/lib/aitbc/data/blockchain/aitbc/blockchain.json'); if blockchain_file.exists(): with open(blockchain_file, 'r') as f: data = json.load(f); logger.info(f'Blockchain: {len(data.get(\"blocks\", []))} blocks'); marketplace_dir = Path('/var/lib/aitbc/data/marketplace'); if marketplace_dir.exists(): listings_file = marketplace_dir / 'gpu_listings.json'; if listings_file.exists(): with open(listings_file, 'r') as f: listings = json.load(f); logger.info(f'Marketplace: {len(listings)} GPU listings'); import psutil; cpu_percent = psutil.cpu_percent(); memory_percent = psutil.virtual_memory().percent; logger.info(f'System: CPU {cpu_percent}%, Memory {memory_percent}%'); time.sleep(30); except Exception as e: logger.error(f'Monitoring error: {e}'); time.sleep(60)" - -# Production reliability -Restart=always -RestartSec=10 - -# Production logging -StandardOutput=journal -StandardError=journal -SyslogIdentifier=aitbc-production-monitor - -# Production security -NoNewPrivileges=true -ProtectSystem=strict -ProtectHome=true -ReadWritePaths=/var/lib/aitbc/data /var/log/aitbc/production - -[Install] -WantedBy=multi-user.target