Pardon my ignorance/simplicity:  why the guessing?  why can&#39;t the user put &#39;set -x&#39; in the script to know what values are being used, what commands executed, and what  stdout and stderr are printed?<br><br clear="all">

-- Asher &quot;still in the job hunt&quot; Vilensky<br>   <a href="mailto:ashervilensky@gmail.com">ashervilensky@gmail.com</a><br>   Home: 404-377-8434<br>   Cell: 404 452 8642<br>
<br><br><div class="gmail_quote">On Mon, Jun 8, 2009 at 1:01 PM, Jim Kinney <span dir="ltr">&lt;<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">On Mon, Jun 8, 2009 at 12:24 PM, Tim Watts&lt;<a href="mailto:timtw@earthlink.net">timtw@earthlink.net</a>&gt; wrote:<br>
&gt; A few possibilities come to mind:<br>
&gt;<br>
&gt; - Could it be a quoting problem (i.e. bash is acting on the quotes and<br>
&gt; effectively turning your command into something like (su initdb) &amp;&amp; (pg_ctl<br>
&gt; start) ...<br>
<br>
</div>I have not tested using &#39;. old carryover from embedded variables led to using &quot;<br>
<div class="im">&gt;<br>
&gt; - Is there evidence that the other commands did NOT, in fact, execute (e.g.<br>
&gt; perhaps they ran but the output got tossed)?<br>
<br>
</div>the other commands did NOT run. suspicious that stdout is &quot;lost&quot; and<br>
thus not dumping failures back to the main shell stdout log file.<br>
<div class="im">&gt;<br>
&gt; - Is it possible that initdb is &#39;short-circuiting&#39; the sub-shell (i.e. exiting<br>
&gt; the sub-shell upon completion thus preventing the other commands from<br>
&gt; running)? Try the sequence w/o initdb by running it separately from the others<br>
&gt; and see if things improve.<br>
<br>
</div>Ah. good idea. Other than lazy, there&#39;s no reason to not have<br>
individual su calls to each command.<br>
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Hope this helps.<br>
&gt;<br>
&gt;<br>
&gt; On Monday 08 June 2009 10:18:57 am Jim Kinney wrote:<br>
&gt;&gt; I have bash script that does a gazillion things. EXCEPT two of the<br>
&gt;&gt; &quot;su&quot; lines don&#39;t do anything.<br>
&gt;&gt;<br>
&gt;&gt; user batadm and postgres are created (correctly - they works) followed by:<br>
&gt;&gt;<br>
&gt;&gt; echo &#39;export PGHOME=/usr/local/postgresql<br>
&gt;&gt; export PGDATA=/data/pgdata<br>
&gt;&gt; export PATH=$PGHOME/bin:$PATH<br>
&gt;&gt; &#39; &gt;&gt; /home/postgres/.bashrc<br>
&gt;&gt;<br>
&gt;&gt; which should set the path to the custom postgresql binaries<br>
&gt;&gt;<br>
&gt;&gt; now run<br>
&gt;&gt;<br>
&gt;&gt; su -l -c &quot;initdb &amp;&amp; pg_ctl start &amp;&amp; createlang plpgsql template1 &amp;&amp;<br>
&gt;&gt; createdb batadm &amp;&amp; createuser -s batadm &quot; postgres &gt;&gt;$log 2&gt;&amp;1<br>
&gt;&gt;<br>
&gt;&gt; where $log is a file defined earlier for install data capture. At this<br>
&gt;&gt; point it shows an execute of initdb and then nothing.<br>
&gt;&gt;<br>
&gt;&gt; Does the -c &quot;stuff&quot; just refuse to run sequential comands? I did the<br>
&gt;&gt; manual su -l batadm and ran the same command sequence successfully<br>
&gt;&gt; after totally deleting all the initdb files structure in postgresql.<br>
&gt;&gt; So the stuff inside the quotes works. $PATH _should_ be updated for<br>
&gt;&gt; the postgres user by the su -l  .<br>
&gt;&gt;<br>
&gt;&gt; The same type of &quot;nothing happens&quot; error occurs later when the batadm<br>
&gt;&gt; user is called to do a series of new sql script inits for the new<br>
&gt;&gt; batadm database. Run manually, the process is fine. Run in a su -l<br>
&gt;&gt; sequence of &amp;&amp;&#39;ed calls it fails and generates no error message.<br>
&gt;&gt;<br>
&gt;&gt; Ideas?<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;<br>
&gt; --<br>
&gt; If I were two-faced, would I be wearing this one?<br>
&gt;  -- Abraham Lincoln<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Ale mailing list<br>
&gt; <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
&gt; <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div><div class="im">--<br>
--<br>
James P. Kinney III<br>
Actively in pursuit of Life, Liberty and Happiness<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
</div></div></blockquote></div><br>