]>
Commit | Line | Data |
---|---|---|
6d1c9c43 IB |
1 | [Unit] |
2 | Description=PostgreSQL database server | |
3 | After=network.target | |
4 | ||
5 | [Service] | |
6 | Type=forking | |
7 | TimeoutSec=120 | |
8 | User=postgres | |
9 | Group=postgres | |
10 | ||
11 | Environment=PGROOT=<%= @mountpoint %>/%i/postgresql | |
12 | ||
13 | SyslogIdentifier=postgres | |
14 | PIDFile=<%= @mountpoint %>/%i/postgresql/postmaster.pid | |
15 | RuntimeDirectory=postgresql | |
16 | RuntimeDirectoryMode=755 | |
17 | ||
18 | ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT} | |
19 | ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT} start -w -t 120 | |
20 | ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT} reload | |
21 | ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT} stop -m fast | |
22 | ||
23 | # Due to PostgreSQL's use of shared memory, OOM killer is often overzealous in | |
24 | # killing Postgres, so adjust it downward | |
25 | OOMScoreAdjust=-200 | |
26 | ||
27 | # Additional security-related features | |
28 | PrivateTmp=true | |
29 | ProtectHome=true | |
30 | ProtectSystem=full | |
31 | NoNewPrivileges=true | |
32 | ||
33 | [Install] | |
34 | WantedBy=multi-user.target |