Thread: Need some help getting started

Need some help getting started

From
Dan
Date:
I'm using Win XP Home

I'm stuck on step 9 of these instructions:

http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4.README

It doesn't say whether I should run it as "postgres"
or my "Dan" account, but neither seems to work.

1) As "Dan", I get:
cygrunsrv: Error starting a service: StartService:
Win32 error 1069:
The service did not start due to a logon failure.

and there's an application Event with these comments:

The description for Event ID ( 0 ) in Source (
postmaster ) cannot be found. The local computer may
not have the necessary registry information or message
DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for
details. The following information is part of the
event: postmaster : PID 3460 : starting service
`postmaster' failed: execv: 1, Operation not
permitted.


2) As "postgres", I get:
cygrunsrv: Error starting a service:
QueryServiceStatus:  Win32 error 1062:
The service has not been started.

and there are the following two application Events:

The description for Event ID ( 0 ) in Source (
postmaster ) cannot be found. The local computer may
not have the necessary registry information or message
DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for
details. The following information is part of the
event: postmaster : PID 4044 : starting service `'
failed: redirect_fd: open (1,
/var/log/postmaster.log): 13, Permission denied.


The description for Event ID ( 0 ) in Source (
postmaster ) cannot be found. The local computer may
not have the necessary registry information or message
DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for
details. The following information is part of the
event: postmaster : PID 2128 : starting service
`postmaster' failed: execv: 1, Operation not
permitted.



BTW, as "postgres", I was getting another error before
giving the postgres user a non-blank password.  You
might want to add that to the instructions.


Thanks in advance for any ideas.


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Re: Need some help getting started

From
Marsh Ray
Date:
Dan wrote:

>I'm using Win XP Home
>
>I'm stuck on step 9 of these instructions:
>
>http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4.README
>
>It doesn't say whether I should run it as "postgres"
>or my "Dan" account, but neither seems to work.
>
I have to run it as my "User" account, i.e., the one that owns the files.
See:

I assume you've seen:
http://www.postgresql.org/docs/faqs/text/FAQ_MSWIN

This is what got me over the hump for Windows XP Home:
http://archives.postgresql.org/pgsql-cygwin/2003-01/msg00068.php
I didn't find the advice in the readme helpful at all for setting rights
on XP Home.

>1) As "Dan", I get:
>cygrunsrv: Error starting a service: StartService:
>Win32 error 1069:
>The service did not start due to a logon failure.
>
Do you have a password set for the account? That was necessary for me.

- Marsh


Re: Need some help getting started

From
Dan
Date:
Thanks.

Yes, my "Dan" and my "postgres" users have non-blank
passwords.

I read these instructions:
http://archives.postgresql.org/pgsql-cygwin/2003-01/msg00068.php

I had these problems:
Step 1) ipc-daemon is not found.  ipc-daemon2 is.
Step 4) Perhaps I need to change "--dep ipc-daemon" to
"--dep ipc-daemon2"
Step 9) I'm getting the same errors as before.

I still can't tell what user we should use for each
step.  Do we still create a "postgres" user at all?  I
honestly do appreciate the author's intention to
explain why things are different, but it would be more
helpful to just see a continuous, usable, corrected
script with blanks to fill in.  Does anyone have one?

Another fun little snag I've discovered is that
somehow mkpasswd translates my "Dan" user to "Owner"
in the etc/passwd file.  I don't know why.  At least I
now know where the "Owner" in my cygwin command prompt
comes from.


Thanks again

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Re: Need some help getting started

From
Jason Tishler
Date:
Dan,

On Sat, Oct 25, 2003 at 02:47:03PM -0700, Dan wrote:
> It doesn't say whether I should run it as "postgres"
> or my "Dan" account, but neither seems to work.
>
> 1) As "Dan", I get:
> cygrunsrv: Error starting a service: StartService:
> Win32 error 1069:
> The service did not start due to a logon failure.

Did you in grant "Dan" the "Log on as a service" right as indicated in
the README?

    3. Grant the "postgres" user the "Log on as a service" user right:

        # cmd /c secpol.msc # [3] [4] [5] [12]

    [snip]

    [12] On Windows XP Home, there is no built in way to assign user
         rights -- use editrights instead:

             $ editrights -u postgres -a SeServiceLogonRight

> [snip]
>
> 2) As "postgres", I get:
> cygrunsrv: Error starting a service:
> QueryServiceStatus:  Win32 error 1062:
> The service has not been started.

Does the following from the README help?

    4. Cygwin PostgreSQL can fail to start or not function properly if
    certain files and directories have incorrect permissions.  The
    following usually solves these kinds of problems:

        $ chmod a+rwx /tmp
        $ chmod a+rx /usr/bin /usr/bin/*
        $ chmod a+rw /var/log # could adversely affect other daemons

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Need some help getting started

From
Dan
Date:
Nope, that didn't work.

But, I found the following line in the
/var/logs/postmaster file.

FATAL:  Can't read lock file /tmp/.s.PGSQL.5432.lock:
Permission denied

I get the following for /tmp when I type "ls -l /"
drwxrwxrwx+   2 Dan    None            0 Oct 27 08:38
tmp

and /tmp/.s.PGSQL.5432.lock does not exist

So, I have another question. Am I looking at the right
README file?  I'm using
/usr/doc/Cygwin/postgresql-7.3.4.README

My copy of this file says to use "ntrights", not
"editrights".


Here again are the 2 errors logged in application
events:

Event 2
The description for Event ID ( 0 ) in Source (
postmaster ) cannot be found. The local computer may
not have the necessary registry information or message
DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for
details. The following information is part of the
event: postmaster : PID 1928 : starting service
`postmaster' failed: execv: 1, Operation not
permitted.

Event 1
The description for Event ID ( 0 ) in Source (
postmaster ) cannot be found. The local computer may
not have the necessary registry information or message
DLL files to display messages from a remote computer.
You may be able to use the /AUXSOURCE= flag to
retrieve this description; see Help and Support for
details. The following information is part of the
event: postmaster : PID 968 : starting service `'
failed: redirect_fd: open (1,
/var/log/postmaster.log): 13, Permission denied.

I'm confused why this says "postmaster.log" instead of
"postmaster".




__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Re: Need some help getting started

From
Jason Tishler
Date:
Dan,

On Mon, Oct 27, 2003 at 10:26:02AM -0800, Dan wrote:
> But, I found the following line in the /var/logs/postmaster file.

What is the above file?

> FATAL:  Can't read lock file /tmp/.s.PGSQL.5432.lock:
> Permission denied
>
> I get the following for /tmp when I type "ls -l /"
> drwxrwxrwx+   2 Dan    None            0 Oct 27 08:38
> tmp
>
> and /tmp/.s.PGSQL.5432.lock does not exist

Sounds like you are eventually going to have to solve the above problem
too.

> So, I have another question. Am I looking at the right README file?

Yes.

> I'm using /usr/doc/Cygwin/postgresql-7.3.4.README

Oh, your previous post mentioned the following:

    On Sat, Oct 25, 2003 at 02:47:03PM -0700, Dan wrote:
    > I'm stuck on step 9 of these instructions:
    >
    > http://www.tishler.net/jason/software/postgresql/postgresql-7.3.4.README

so I thought you were using the online version and not the one that is
part of the package.

> My copy of this file says to use "ntrights", not "editrights".

I just updated the above URL.  Hence, the difference.

> Here again are the 2 errors logged in application
> events:
>
> Event 2
> [snip]
> postmaster : PID 1928 : starting service
> `postmaster' failed: execv: 1, Operation not permitted.
>
> Event 1
> [snip]
> postmaster : PID 968 : starting service `' <***
> failed: redirect_fd: open (1, /var/log/postmaster.log): 13, Permission denied.

If you Google on the above, you will see that my previous suggestion
solved the these problems in the past.

BTW, where did the service name go in "<***" above?

> I'm confused why this says "postmaster.log" instead of "postmaster".

The cygrunsrv usage indicates the following:

    $ cygrunsrv --help

    Usage: cygrunsrv [OPTION]...
    [snip]
    -1, --stdout <file>       Optional output file used for stdout redirection.
                              Default is /var/log/<svc_name>.log.
    [snip]

Hence, postmaster when running as a service under Cygwin usually logs to
/var/log/postmaster.log.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Need some help getting started

From
Jason Tishler
Date:
Dan,

Please keep you replies on-list.

On Mon, Oct 27, 2003 at 02:40:47PM -0800, Dan wrote:
> One more thing.. I don't know if "editrights" was installed when I
> downloaded and installed ntrights.  If so, there should be a step to
> download ntrights.

My README is already too "cluttered."  IMO, adding this obvious step
will only make it more so.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Need some help getting started

From
Dan
Date:
--- Jason Tishler <jason@tishler.net> wrote:
> Dan,
>
> Please keep you replies on-list.
>

Since you're the one who's maintaining the README, I
sent my question to you alone.  Otherwise, if I was
wrong about the editrights thing, there would be
confusing/bogus info in the mail archive.  That's
important to me as a newbie.  I should have mentioned
that in the last message.  I think you probably didn't
get my other email with the revised README attachment.
 This would have made more sense in that context.


> On Mon, Oct 27, 2003 at 02:40:47PM -0800, Dan wrote:
> > One more thing.. I don't know if "editrights" was
> installed when I
> > downloaded and installed ntrights.  If so, there
> should be a step to
> > download ntrights.
>
> My README is already too "cluttered."  IMO, adding
> this obvious step
> will only make it more so.

I respectfully disagree.  I am very grateful for your
help and maintenance of the guide, but it took me
three days to get this thing to work.  Excluding
what's "obvious" isn't the way to attract new users.
Making it idiot-proof is.  Surely keeping it
"uncluttered" is not more important than attracting
new users.  I can't imagine a prospective user
choosing a different product because the postgresql
installation instructions insulted his intelligence
with obvious info.

IMO, there wasn't too much information, but rather
having footnotes and omitting what's obvious made it
harder to use than if verbose information was placed
in-line.  Consider me a usability tester of the
postgres cygwin setup process.  I'm just offering my
feedback as a user.

Did you get my revised README?  I sent it as an
attachment in a separate email. I'd like you to review
and post it if you like it, or correct it if you
don't. Again, to keep the mail archives free from
inconsistent information, I sent it only to you.

So that there's only one source of instructions, I'd
rather not just post it in a message here, but I will
if you prefer.

I wonder why these instructions are not just part of
the postgresql docs.  They're really nice and that's
the first place everyone looks.

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Re: Need some help getting started

From
Jason Tishler
Date:
Dan,

On Tue, Oct 28, 2003 at 10:36:49AM -0800, Dan wrote:
> --- Jason Tishler <jason@tishler.net> wrote:
> > Please keep you replies on-list.
>
> Since you're the one who's maintaining the README, I sent my question
> to you alone.  Otherwise, if I was wrong about the editrights thing,
> there would be confusing/bogus info in the mail archive.  That's
> important to me as a newbie.  I should have mentioned that in the last
> message.

Understood.  Nevertheless, the proper place to discuss these matters is
the appropriate mailing list.  Unfortunately, individuals do not scale
-- mailing list do.

> I think you probably didn't get my other email with the revised README
> attachment.

I just checked my spam folder (and inbox).  I did not receive the above
email.

> This would have made more sense in that context.

Agreed.

> > On Mon, Oct 27, 2003 at 02:40:47PM -0800, Dan wrote:
> > > One more thing.. I don't know if "editrights" was installed when I
> > > downloaded and installed ntrights.  If so, there should be a step
> > > to download ntrights.
> >
> > My README is already too "cluttered."  IMO, adding this obvious step
> > will only make it more so.
>
> I respectfully disagree.

The purpose of my README is to describe the differences between a Cygwin
and Unix PostgreSQL setup.  The goal was not to provide exhaustive
Cygwin and PostgreSQL documentation.  This documentation can be found
elsewhere.

> I am very grateful for your help and maintenance of the guide,

You are welcome.


> but it took me three days to get this thing to work.

Sorry, but it appears that XP Home adds to the complexity of setting up
Cygwin PostgreSQL.  AFAICT, installation on other Windows versions is
easier.

> Excluding what's "obvious" isn't the way to attract new users.
> [snip]
> I'm just offering my feedback as a user.

I appreciate your feedback.  However, the harsh reality is that I only
have very limited spare time and many interests.  Hence, rewriting a
README is very low on my priority list.  FWIW, others have reported to
me that they found my README easy to follow and useful.

> Did you get my revised README?

No.

> I sent it as an attachment in a separate email. I'd like you to review
> and post it if you like it, or correct it if you don't. Again, to keep
> the mail archives free from inconsistent information, I sent it only
> to you.

I would prefer a patch (i.e., diff) instead.  It is much easier to
quickly see your changes.

> So that there's only one source of instructions, I'd rather not just
> post it in a message here, but I will if you prefer.

I think you know my preferences, but I will leave it up to you.

> I wonder why these instructions are not just part of the postgresql
> docs.  They're really nice and that's the first place everyone looks.

Why not contribute the above to the PostgreSQL docs?

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Need some help getting started

From
Dan
Date:
Jason,

Nevermind,  I'm not getting anywhere here.  I'll post
the steps that worked for me to this list and post a
link to it in the postgresql docs.

Dan

__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

Re: Need some help getting started

From
Dan
Date:
PostgreSQL-Cygwin Installation Steps


On Windows 9x/Me, you can only install postgresql as
an app:

1. Start the cygipc ipc-daemon2:

    $ ipc-daemon2 &

2. Initialize PostgreSQL:

    $ initdb -D /usr/share/postgresql/data

3. Start the PostgreSQL postmaster:

    $ postmaster -D /usr/share/postgresql/data &

4. Connect to PostgreSQL:

    $ psql template1


For Windows XP Home, Windows XP Pro, Windows NT 4.0,
Windows 2000, it's better to install it as a service:

In the following steps, replace the following
placeholders with appropriate values:
[USER_1] : Any Windows Admin user. Example: joeuser.
[POSTGRES_USER_DIR]: directory to the postgres user's
home directory.  Example: /home/postgres
[POSTGRES_PASSWORD]: password for postgres user
account.  Must be non-blank.  Example: anonblankpwd

1. Make sure Cygwin's bin directory (e.g.,
C:\Cygwin\bin) is added to the
    Windows NT/2000's system PATH and the machine
rebooted for the SCM
    to find cygwin1.dll.

2. Log in as [USER_1]

3. Install the cygipc ipc-daemon2 as a NT service:

    $ ipc-daemon2 --install-as-service

4. Create the "postgres" user account:

    $ net user postgres [POSTGRES_PASSWORD] /add
/fullname:postgres /comment:'PostgreSQL user account'
/homedir:"[POSTGRES_DIR]"
    $ mkpasswd -l -u postgres >>/etc/passwd

5. Grant the "postgres" user the "Log on as a service"
user right.  (See
http://support.microsoft.com/default.aspx?scid=KB;en-us;q259733
for
    a Microsoft KB article explaining how to configure
user rights.):

    # If on Windows XP Home:
    #   I think you have to download and install the
ntrights utility for setting nt permissions
    #   from here
http://www.dynawell.com/reskit/microsoft/win2000/ntrights.zip

    $ editrights -u postgres -a SeServiceLogonRight
    # else if on Windows NT 4.0:
    #   start User Manager, select Policies, and then
select User Rights...
    # else if on Windows 2000 or XP Pro:
        $ cmd /c secpol.msc

6. Install postmaster as a NT service (Clean
postmaster shutdown will only work with a post Cygwin
1.3.2
    snapshot from 2001-Jul-28 or later.):

    $ cygrunsrv --install postmaster --path
/usr/bin/postmaster --args "-D
/usr/share/postgresql/data -i" --dep ipc-daemon2
--termsig INT --user postgres --shutdown

7. Create the PostgreSQL data directory:

    $ mkdir /usr/share/postgresql/data

8. Change ownership of the PostgreSQL data directory
(Assumes that ntsec is set via the CYGWIN environment
variable):

    $ chown postgres /usr/share/postgresql/data

9. Start the cygipc ipc-daemon2
       If ipc-daemon2 is not running or a version
previous to
       2.01-1 is running, then initdb and postmaster
can fail with the error
       message:
           IpcSemaphoreCreate: semget(...) failed:
Function not implemented
       and
           IpcMemoryCreate: shmget(...) failed:
Function not implemented
       respectively.

    $ cygrunsrv -S ipc-daemon2

10. Switch from [USER_1] to "postgres":

11. Initialize PostgreSQL:

    $ initdb -D /usr/share/postgresql/data

12. Switch from "postgres" to [USER_1]:

13. Start postmaster:

    $ cygrunsrv -S postmaster

14. Verify postmaster is running (If postmaster fails
to start, then examine /var/log/postmaster.log
     and/or the NT Event Log):

    $ cygrunsrv -Q postmaster

15. Connect to PostgreSQL (This can be run as any
user.  One can use PostgreSQL's createuser command or
set PGUSER to obviate
    the need to specify "-U postgres" on the psql
command line):

    $ psql -U postgres template1


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/