免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9642 | 回复: 0
打印 上一主题 下一主题

script for systemd [复制链接]

论坛徽章:
1
水瓶座
日期:2014-03-20 18:21:14
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2016-09-09 11:27 |只看该作者 |倒序浏览
  1. $ ls -l /usr/lib/systemd/system/postgresql-9.4.service
  2. -rw-r--r--. 1 root root 1628 Aug 11 08:02 /usr/lib/systemd/system/postgresql-9.4.service
复制代码
  1. # It's not recommended to modify this file in-place, because it will be
  2. # overwritten during package upgrades.  If you want to customize, the
  3. # best way is to create a file "/etc/systemd/system/postgresql-9.4.service",
  4. # containing
  5. #        .include /lib/systemd/system/postgresql-9.4.service
  6. #        ...make your changes here...
  7. # For more info about custom unit files, see
  8. # http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F

  9. # Note: changing PGDATA will typically require adjusting SELinux
  10. # configuration as well.

  11. # Note: do not use a PGDATA pathname containing spaces, or you will
  12. # break postgresql-setup.
  13. [Unit]
  14. Description=PostgreSQL 9.4 database server
  15. After=syslog.target
  16. After=network.target

  17. [Service]
  18. Type=forking

  19. User=postgres
  20. Group=postgres

  21. # Note: avoid inserting whitespace in these Environment= lines, or you may
  22. # break postgresql-setup.

  23. # Location of database directory
  24. Environment=PGDATA=/var/lib/pgsql/9.4/data/

  25. # Where to send early-startup messages from the server (before the logging
  26. # options of postgresql.conf take effect)
  27. # This is normally controlled by the global default set by systemd
  28. # StandardOutput=syslog

  29. # Disable OOM kill on the postmaster
  30. OOMScoreAdjust=-1000

  31. ExecStartPre=/usr/pgsql-9.4/bin/postgresql94-check-db-dir ${PGDATA}
  32. ExecStart=/usr/pgsql-9.4/bin/pg_ctl start -D ${PGDATA} -s -w -t 300
  33. ExecStop=/usr/pgsql-9.4/bin/pg_ctl stop -D ${PGDATA} -s -m fast
  34. ExecReload=/usr/pgsql-9.4/bin/pg_ctl reload -D ${PGDATA} -s

  35. # Give a reasonable amount of time for the server to start up/shut down
  36. TimeoutSec=300

  37. [Install]
  38. WantedBy=multi-user.target
复制代码



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP