Fix examples of how to use "su" while starting the server.
authorTom Lane
Tue, 25 Sep 2012 17:52:53 +0000 (13:52 -0400)
committerTom Lane
Tue, 25 Sep 2012 17:52:53 +0000 (13:52 -0400)
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.

doc/src/sgml/runtime.sgml

index a47c998524dec55675f7beb4ff7a61198f6580db..d76e1c571059d0f8e0e0f7b022488eee7f5e298f 100644 (file)
@@ -286,10 +286,10 @@ pg_ctl start -l logfile
    rc.d directories. Whatever you do, the server must be
    run by the PostgreSQL user account
    and not by root or any other user. Therefore you
-   probably should form your commands using su -c '...'
-   postgres.  For example:
+   probably should form your commands using
+   su postgres -c '...'.  For example:
 
-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'
 
   
 
@@ -315,7 +315,7 @@ su -c 'pg_ctl start -D /usr/local/pgsql/data -l serverlog' postgres
       OpenBSDstart script
 
 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
 
@@ -738,7 +738,7 @@ psql: could not connect to server: No such file or directory
       FreeBSDIPC configuration
       
        
-        The default settings can be changed using 
+        The default settings can be changed using
         the sysctl or
         loader interfaces.  The following
         parameters can be set using sysctl: