[Unit] Description=Palladium Monitor After=network.target [Service] Type=simple WorkingDirectory=/root/palladium-monitor ExecStart=/usr/bin/python3 /root/palladium-monitor/app.py Restart=on-failure RestartSec=5 Environment=PYTHONUNBUFFERED=1 # 安全加固 NoNewPrivileges=yes PrivateTmp=yes # 邮件相关环境变量(按需取消注释并修改) # Environment="SMTP_HOST=smtp.example.com" # Environment="SMTP_PORT=587" # Environment="SMTP_USE_TLS=true" # Environment="SMTP_USER=your@email.com" # Environment="SMTP_PASSWORD=yourpassword" # Environment="MAIL_FROM=your@email.com" # Environment="MAIL_TO=admin@example.com" # Environment="MAIL_ENABLED=true" # Environment="MAIL_SEND_HOUR=9" # Environment="ALLOW_EMAIL_TRIGGER=true" [Install] WantedBy=multi-user.target