diff options
author | Tom Lane | 2012-09-25 17:53:01 +0000 |
---|---|---|
committer | Tom Lane | 2012-09-25 17:53:01 +0000 |
commit | bc99397563ff88c31078d4bf66b8538c78a08bda (patch) | |
tree | f83459717ee9cb3dcf65cb9a70daa09210c44298 | |
parent | 04a37a5716867f8eade144baac847a9737ac22f5 (diff) |
Fix examples of how to use "su" while starting the server.
The syntax "su -c 'command' username" is not accepted by all versions of
su, for example not OpenBSD's. More portable is "su username -c
'command'". So change runtime.sgml to recommend that syntax. Also,
add a -D switch to the OpenBSD example script, for consistency with other
examples. Per Denis Lapshin and Gábor Hidvégi.
-rw-r--r-- | doc/src/sgml/runtime.sgml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 4964de394f4..e1c290fec51 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -286,10 +286,10 @@ pg_ctl start -l logfile <filename>rc.d</> directories. Whatever you do, the server must be run by the <productname>PostgreSQL</productname> user account <emphasis>and not by root</emphasis> or any other user. Therefore you - probably should form your commands using <literal>su -c '...' - postgres</literal>. For example: + probably should form your commands using + <literal>su postgres -c '...'</literal>. For example: <programlisting> -su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres +su postgres -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' </programlisting> </para> @@ -315,7 +315,7 @@ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres <indexterm><primary>OpenBSD</><secondary>start script</secondary></> <programlisting> if [ -x /usr/local/pgsql/bin/pg_ctl -a -x /usr/local/pgsql/bin/postgres ]; then - su - -c '/usr/local/pgsql/bin/pg_ctl start -l /var/postgresql/log -s' postgres + su -l postgres -c '/usr/local/pgsql/bin/pg_ctl start -s -l /var/postgresql/log -D /usr/local/pgsql/data' echo -n ' postgresql' fi </programlisting> |