Skip to content
Snippets Groups Projects
Commit 7d8cbeb0 authored by Tom Lane's avatar Tom Lane
Browse files

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.
parent 2a0c81a1
No related branches found
No related tags found
Loading
...@@ -286,10 +286,10 @@ pg_ctl start -l logfile ...@@ -286,10 +286,10 @@ pg_ctl start -l logfile
<filename>rc.d</> directories. Whatever you do, the server must be <filename>rc.d</> directories. Whatever you do, the server must be
run by the <productname>PostgreSQL</productname> user account run by the <productname>PostgreSQL</productname> user account
<emphasis>and not by root</emphasis> or any other user. Therefore you <emphasis>and not by root</emphasis> or any other user. Therefore you
probably should form your commands using <literal>su -c '...' probably should form your commands using
postgres</literal>. For example: <literal>su postgres -c '...'</literal>. For example:
<programlisting> <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> </programlisting>
</para> </para>
...@@ -315,7 +315,7 @@ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres ...@@ -315,7 +315,7 @@ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres
<indexterm><primary>OpenBSD</><secondary>start script</secondary></> <indexterm><primary>OpenBSD</><secondary>start script</secondary></>
<programlisting> <programlisting>
if [ -x /usr/local/pgsql/bin/pg_ctl -a -x /usr/local/pgsql/bin/postgres ]; then 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' echo -n ' postgresql'
fi fi
</programlisting> </programlisting>
...@@ -738,7 +738,7 @@ psql: could not connect to server: No such file or directory ...@@ -738,7 +738,7 @@ psql: could not connect to server: No such file or directory
<indexterm><primary>FreeBSD</><secondary>IPC configuration</></> <indexterm><primary>FreeBSD</><secondary>IPC configuration</></>
<listitem> <listitem>
<para> <para>
The default settings can be changed using The default settings can be changed using
the <command>sysctl</command> or the <command>sysctl</command> or
<command>loader</command> interfaces. The following <command>loader</command> interfaces. The following
parameters can be set using <command>sysctl</command>: parameters can be set using <command>sysctl</command>:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment