Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. # systemd service template for PostgreSQL clusters. The actual instances will
  2. # be called "postgresql@version-cluster", e.g. "postgresql@9.3-main". The
  3. # variable %i expands to "version-cluster", %I expands to "version/cluster".
  4. # (%I breaks for cluster names containing dashes.)
  5.  
  6. [Unit]
  7. Description=PostgreSQL Cluster %i
  8. ConditionPathExists=/etc/postgresql/%I/postgresql.conf
  9. PartOf=postgresql.service
  10. ReloadPropagatedFrom=postgresql.service
  11. Before=postgresql.service
  12.  
  13. [Service]
  14. Type=forking
  15. # -: ignore startup failure (recovery might take arbitrarily long)
  16. # the actual pg_ctl timeout is configured in pg_ctl.conf
  17. ExecStart=-/usr/bin/pg_ctlcluster --skip-systemctl-redirect %i start
  18. # 0 is the same as infinity, but "infinity" needs systemd 229
  19. TimeoutStartSec=0
  20. ExecStop=/usr/bin/pg_ctlcluster --skip-systemctl-redirect -m fast %i stop
  21. TimeoutStopSec=1h
  22. ExecReload=/usr/bin/pg_ctlcluster --skip-systemctl-redirect %i reload
  23. PIDFile=/var/run/postgresql/%i.pid
  24. SyslogIdentifier=postgresql@%i
  25. # prevent OOM killer from choosing the postmaster (individual backends will
  26. # reset the score to 0)
  27. OOMScoreAdjust=-900
  28. # restarting automatically will prevent "pg_ctlcluster ... stop" from working,
  29. # so we disable it here. Also, the postmaster will restart by itself on most
  30. # problems anyway, so it is questionable if one wants to enable external
  31. # automatic restarts.
  32. #Restart=on-failure
  33. # (This should make pg_ctlcluster stop work, but doesn't:)
  34. #RestartPreventExitStatus=SIGINT SIGTERM
  35.  
  36. [Install]
  37. WantedBy=multi-user.target
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement