Shell

Sarah Reichelt sarah.reichelt at gmail.com
Sat Oct 21 22:33:21 EDT 2006


Try this:

put "#!/bin/sh" & cr into tScript
put "pw=" & quote & tPass & quote & cr after tScript
put "echo $pw | sudo -S - postgres" & cr after tScript
put "/usr/local/bin/postmaster -D /usr/local/pgsql/data -i" & cr after tScript
put shell(tScript) into tCheck  -- do the command & get the result

The tPass variable must contain your admin password.

Cheers,
Sarah


On 10/19/06, hershf at rgllc.us <hershf at rgllc.us> wrote:
> Quoting Sarah Reichelt <sarah.reichelt at gmail.com>:
>
> > I have never used PostgreSQL, so I don't know how you normally start
> > it. However from the error message, it appears that you don't start it
> > with sudo, just with a standard user's login.
> >
> > Can you start PostgreSQL as normal from the Terminal and post the
> > commands you use (blanking out any password). Then we can see how that
> > needs to be altered to work directly from Rev.
> >
> > One other point: the message box does not always act exactly the same
> > as a script in an object, so for testing, I suggest you make a button
> > and do this in a mouseUp handler.
> >
> > Cheers,
> > Sarah
> first of all thanks for your response and sorry for the delay, accidently I
> posted my password and had to change it immediatly and some how my computer
> got locked and took a while till i got back to business plus the holidays.
> Ok, I open terminal, quote
> Hershel-Fischs-Computer:~ hershelfisch$ su - postgres
> Password:
> Hershel-Fischs-Computer:~ postgres$ /usr/local/bin/postmaster -D /usr/local/
> pgsql/data -i
> and quote
> Thanks a million, Hersel Fisch
>
> LOG:  database system was shut down at 2006-10-18 16:19:56 EDT
> LOG:  checkpoint record is at 0/AD3C8C
> LOG:  redo record is at 0/AD3C8C; undo record is at 0/0; shutdown TRUE
> LOG:  next transaction ID: 1469; next OID: 17250
> LOG:  database system is ready
>
> >
> >
> > On 10/5/06, Hershel Fisch <hershf at rgllc.us> wrote:
> > > On 10/4/06 6:51 AM, "Sarah Reichelt" <sarah.reichelt at gmail.com> wrote:
> > > Thanks,
> > >  this is what I put into the message box
> > >
> > > put "#!/bin/sh" & cr into tScript put "pw=" & quote & "vehachhkl" & quote
> > &
> > > cr after tScript
> > > put "echo $pw | sudo -S /usr/local/bin/postmaster -D /usr/local/pgsql/data
> > -
> > > i" & cr after tScript
> > > put shell(tScript)
> > >
> > > This is the result for the above script
> > > Password:
> > > "root" execution of the PostgreSQL server is not permitted.
> > > The server must be started under an unprivileged user ID to prevent
> > > possible system security compromise.  See the documentation for
> > > more information on how to properly start the server.
> > >
> > > --put "#!/bin/sh" & cr into tScript
> > > put "pw=" & quote & "vehachhkl" & quote & cr after tScript
> > > put "echo $pw | sudo -S /usr/local/bin/postmaster -D /usr/local/pgsql/data
> > -
> > > i" & cr after tScript
> > > put shell(tScript)
> > >
> > > And this is the result for this script, I'm wondering.
> > > 1
> > > But it doesn't open "postgres"
> > > Thanks again.
> > > Hershel
> > >
> > >
> > > > On 10/4/06, Hershel Fisch <hershf at rgllc.us> wrote:
> > > >> Hi, I'd greatly appreciate if some one can help me out on this one.
> > > >> How do I write this command with the shell function, I would write it
> > in
> > > >> terminal as follows
> > > >>
> > > >> Su -  myUsr
> > > >> Password:
> > > >> And another command.
> > > >>
> > > >> Now the question is that every line above is a different entry
> > > >> If I put
> > > >> Put shell("su - myUsr") in the message box this is the result
> > > >> "Password's: Sorry"
> > > >>
> > > >> And also if I understand correctly every command with the shell
> function
> > is
> > > >> a different terminal and does not correspond to the previous shell
> > reply, is
> > > >> that true? If so how do I write that every command should correspond to
> > the
> > > >> previously respond?
> > > >
> > > >
> > > > You have to construct the shell commands as a single string and do it
> > > > all at once. Here's an example of how to use sudo to set the system
> > > > clock, but just put whatever you want after the "-S".
> > > >
> > > > put "#!/bin/sh" & cr into tScript
> > > > put "pw=" & quote & tPass & quote & cr after tScript
> > > > put "echo $pw | sudo -S date " & tDate & tTime & cr after tScript
> > > > -- build the command lines, the command you need to run goes after the
> > -S
> > > > put shell(tScript) into tCheck  -- do the command & get the result
> > > >
> > > > You have to quote your admin password, but you can ask for that when
> > > > running the script, or store it in a custom property.
> > > >
> > > > HTH,
> > > > Sarah
> > > > _______________________________________________
> > > > use-revolution mailing list
> > > > use-revolution at lists.runrev.com
> > > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription
> > > > preferences:
> > > > http://lists.runrev.com/mailman/listinfo/use-revolution
> > >
> > > _______________________________________________
> > > use-revolution mailing list
> > > use-revolution at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-revolution
> > >
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your subscription
> > preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>
>
>
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list