As suggested by joerg@, "cd /" works even when initdb hasn't happened yet. Ride previous PKGREVISION bump.diff -r1.2 -r1.3 pkgsrc/databases/postgresql10-server/files/pgsql.sh
(schmonz)
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:55 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:43 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:55 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:43 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:55 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:44 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:55 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:44 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:55 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:44 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!@RCD_SCRIPTS_SHELL@ | 1 | #!@RCD_SCRIPTS_SHELL@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pgsql.sh,v 1.2 2019/02/06 18:45:56 schmonz Exp $ | 3 | # $NetBSD: pgsql.sh,v 1.3 2019/02/06 22:33:44 schmonz 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 | |
@@ -35,27 +35,27 @@ initdb_cmd="pgsql_initdb" | @@ -35,27 +35,27 @@ 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 | |
45 | . /etc/rc.conf | 45 | . /etc/rc.conf | |
46 | fi | 46 | fi | |
47 | 47 | |||
48 | cd "${pgsql_home}" | 48 | cd / | |
49 | 49 | |||
50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | 50 | command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" | |
51 | if [ -n "${pgsql_flags}" ]; then | 51 | if [ -n "${pgsql_flags}" ]; then | |
52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | 52 | command_args="${command_args} -o \\\"${pgsql_flags}\\\"" | |
53 | fi | 53 | fi | |
54 | 54 | |||
55 | pgsql_precmd() | 55 | pgsql_precmd() | |
56 | { | 56 | { | |
57 | ulimit -n 4096 | 57 | ulimit -n 4096 | |
58 | if [ ! -d ${pgsql_home}/data/base ]; then | 58 | if [ ! -d ${pgsql_home}/data/base ]; then | |
59 | pgsql_initdb | 59 | pgsql_initdb | |
60 | fi | 60 | fi | |
61 | } | 61 | } |