| @@ -1,44 +1,44 @@ | | | @@ -1,44 +1,44 @@ |
1 | #!@RCD_SCRIPTS_SHELL@ | | 1 | #!@RCD_SCRIPTS_SHELL@ |
2 | # | | 2 | # |
3 | # $NetBSD: pgsql.sh,v 1.4 2011/03/04 14:26:23 adam Exp $ | | 3 | # $NetBSD: pgsql.sh,v 1.5 2011/09/27 07:25:05 adam Exp $ |
4 | # | | 4 | # |
5 | # PostgreSQL database rc.d control script | | 5 | # PostgreSQL database rc.d control script |
6 | # | | 6 | # |
7 | # PROVIDE: pgsql | | 7 | # PROVIDE: pgsql |
8 | # REQUIRE: DAEMON | | 8 | # REQUIRE: DAEMON |
9 | # KEYWORD: shutdown | | 9 | # KEYWORD: shutdown |
10 | # | | 10 | # |
11 | # You will need to set some variables in /etc/rc.conf to start PostgreSQL: | | 11 | # You will need to set some variables in /etc/rc.conf to start PostgreSQL: |
12 | # | | 12 | # |
13 | # pgsql=YES | | 13 | # pgsql=YES |
14 | # | | 14 | # |
15 | # Optionally, "pgsql_flags" contains options for the PostgreSQL postmaster, e.g. | | 15 | # Optionally, "pgsql_flags" contains options for the PostgreSQL postmaster, e.g. |
16 | # pgsql_flags="-i" # allows TCP/IP connections | | 16 | # pgsql_flags="-i" # allows TCP/IP connections |
17 | # pgsql_flags="-i -l" # enables SSL connections | | 17 | # pgsql_flags="-i -l" # enables SSL connections |
18 | # pgsql_home="/path/to/home" # path to pgsql database directory | | 18 | # pgsql_home="/path/to/home" # path to pgsql database directory |
19 | # See postmaster(1) for possible options. | | 19 | # See postmaster(1) for possible options. |
20 | | | 20 | |
21 | if [ -f /etc/rc.subr ]; then | | 21 | if [ -f /etc/rc.subr ]; then |
22 | . /etc/rc.subr | | 22 | . /etc/rc.subr |
23 | fi | | 23 | fi |
24 | | | 24 | |
25 | name="pgsql" | | 25 | name="pgsql" |
26 | rcvar=${name} | | 26 | rcvar=${name} |
27 | command="@PREFIX@/bin/pg_ctl" | | 27 | command="@PREFIX@/bin/pg_ctl" |
28 | procname="@PREFIX@/bin/postgres" | | 28 | procname="@PREFIX@/bin/postgres" |
29 | pgsql_user="@PGUSER@" | | 29 | : ${pgsql_user:=@PGUSER@} |
30 | pgsql_group="@PGGROUP@" | | 30 | : ${pgsql_group:=@PGGROUP@} |
31 | pgsql_home="@PGHOME@" | | 31 | : ${pgsql_home:=@PGHOME@} |
32 | | | 32 | |
33 | extra_commands="initdb reload" | | 33 | extra_commands="initdb reload" |
34 | initdb_cmd="pgsql_initdb" | | 34 | initdb_cmd="pgsql_initdb" |
35 | start_precmd="pgsql_precmd" | | 35 | start_precmd="pgsql_precmd" |
36 | start_cmd="pgsql_start" | | 36 | start_cmd="pgsql_start" |
37 | restart_precmd="pgsql_precmd" | | 37 | restart_precmd="pgsql_precmd" |
38 | restart_cmd="pgsql_restart" | | 38 | restart_cmd="pgsql_restart" |
39 | stop_cmd="pgsql_stop" | | 39 | stop_cmd="pgsql_stop" |
40 | reload_cmd="pgsql_reload" | | 40 | reload_cmd="pgsql_reload" |
41 | | | 41 | |
42 | if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then | | 42 | if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then |
43 | load_rc_config $name | | 43 | load_rc_config $name |
44 | elif [ -f /etc/rc.conf ]; then | | 44 | elif [ -f /etc/rc.conf ]; then |