bot.service 617 B

123456789101112131415161718192021222324
  1. [Unit]
  2. Description=IRC bot
  3. Wants=network-online.target
  4. After=network.target network-online.target
  5. #After=network.target network-online.target stunnel4.service
  6. #Requires=stunnel4.service
  7. # Try to restart the bot during the first 16*60=960 seconds after failure:
  8. StartLimitIntervalSec=960
  9. # Try max 16 times:
  10. StartLimitBurst=16
  11. # To clear start limit counters: systemctl reset-failed bot.
  12. [Service]
  13. Type=forking
  14. PIDFile=/home/bot/profile/app.pid
  15. ExecStart=/home/bot/bot /home/bot/profile
  16. User=bot
  17. Restart=on-failure
  18. # Wait 60 seconds before a restart after failure:
  19. RestartSec=60
  20. [Install]
  21. WantedBy=multi-user.target