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