Advertisement
krot

systemd service

Nov 28th, 2020 (edited)
1,007
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.01 KB | None | 0 0
  1. [Unit]
  2. Description=app
  3.  
  4. [Service]
  5. # This will allow using `systemd:notify/1` for informing the system supervisor
  6. # about application status.
  7. Type=notify
  8. #Type=simple
  9. # Application need to start in foreground instead of forking into background,
  10. # otherwise it may be not correctly detected and system will try to start it
  11. # again.
  12. ExecStart=/root/....aa foreground
  13. # Enable watchdog process, which will expect messages in given timeframe,
  14. # otherwise it will restart the process as a defunct. It should be managed
  15. # automatically by `systemd` application in most cases and will send messages
  16. # twice as often as requested.
  17. #
  18. # You can force failure by using `systemd:watchdog(trigger)` or manually ping
  19. # systemd watchdog via `systemd:watchdog(ping)`.
  20. WatchdogSec=10s
  21. Restart=on-failure
  22.  
  23. [Install]
  24. WantedBy=multi-user.target
  25.  
  26.  
  27. /etc/systemd/system/*.service
  28. sudo systemd-analyze verify NAME.service
  29. https://www.codercto.com/a/100315.html
  30. https://github.com/hauleth/erlang-systemd
  31. https://hexdocs.pm/systemd/
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement