| 1 |
# pgsql |
| 2 |
|
| 3 |
CONFIG |
| 4 |
Agent pgsql |
| 5 |
AgentRoot /usr/lib/ocf/resource.d/heartbeat |
| •6 |
InstallPackage postgresql |
| 7 |
HangTimeout 40 |
| 8 |
|
| 9 |
SETUP-AGENT |
| •10 |
# nothing |
| 11 |
|
| 12 |
VARIABLE |
| 13 |
cluster_name="$(pg_conftool -s show cluster_name)" |
| 14 |
cluster_version="$(pg_conftool -s show cluster_name | cut -d/ -f1)" |
| 15 |
|
| 16 |
CASE-BLOCK crm_setting |
| •17 |
Env OCF_RESKEY_CRM_meta_timeout=30000 |
| 18 |
Env OCF_RESKEY_pgctl=/usr/lib/postgresql/$cluster_version/bin/pg_ctl |
| 19 |
Env OCF_RESKEY_pgdata=/var/lib/postgresql/$cluster_name |
| 20 |
Env OCF_RESKEY_config=/etc/postgresql/$cluster_name/postgresql.conf |
| 21 |
Env OCF_RESKEY_socketdir=/var/run/postgresql |
| 22 |
|
| 23 |
CASE-BLOCK default_status |
| 24 |
AgentRun stop |
| 25 |
|
| 26 |
CASE-BLOCK prepare |
| 27 |
Include crm_setting |
| 28 |
Include default_status |
| 29 |
|
| 30 |
CASE "check base env" |
| 31 |
Include prepare |
| 32 |
AgentRun start OCF_SUCCESS |
| 33 |
|
| 34 |
CASE "check base env: invalid 'OCF_RESKEY_pgctl'" |
| 35 |
Include prepare |
| 36 |
Env OCF_RESKEY_pgctl=no_such |
| 37 |
AgentRun start OCF_ERR_INSTALLED |
| 38 |
|
| 39 |
CASE "normal start" |
| 40 |
Include prepare |
| 41 |
AgentRun start OCF_SUCCESS |
| 42 |
|
| 43 |
CASE "normal stop" |
| 44 |
Include prepare |
| 45 |
AgentRun start |
| 46 |
AgentRun stop OCF_SUCCESS |
| 47 |
|
| 48 |
CASE "double start" |
| 49 |
Include prepare |
| 50 |
AgentRun start |
| 51 |
AgentRun start OCF_SUCCESS |
| 52 |
|
| 53 |
CASE "double stop" |
| 54 |
Include prepare |
| 55 |
AgentRun stop OCF_SUCCESS |
| 56 |
|
| 57 |
CASE "running monitor" |
| 58 |
Include prepare |
| 59 |
AgentRun start |
| 60 |
AgentRun monitor OCF_SUCCESS |
| 61 |
|
| 62 |
CASE "not running monitor" |
| 63 |
Include prepare |
| 64 |
AgentRun monitor OCF_NOT_RUNNING |
| 65 |
|
| 66 |
CASE "unimplemented command" |
| 67 |
Include prepare |
| 68 |
AgentRun no_cmd OCF_ERR_UNIMPLEMENTED |
| 69 |
|
| 70 |
CASE "non-existent user" |
| 71 |
Include prepare |
| 72 |
Env OCF_RESKEY_pgdba=no_user |
| 73 |
AgentRun start OCF_ERR_INSTALLED |
| 74 |
|
| 75 |
CASE "invalid user" |
| 76 |
Include prepare |
| 77 |
Env OCF_RESKEY_pgdba=nobody |
| 78 |
AgentRun start OCF_ERR_PERM |