pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feednew install starting backend
2+ messages / 2 participants
[nested] [flat]
* new install starting backend
@ 2004-08-17 23:23 David Bear <David.Bear@asu.edu>
0 siblings, 1 reply; 2+ messages in thread
From: David Bear @ 2004-08-17 23:23 UTC (permalink / raw)
To: pgsql-admin
I installed postgres from the freebsd ports collection.
Then, after doing the initdb, I tried to run the backend as the
postgres user, ie while su'ed as pgsql. I was prompt for a password.
Since I had not change and pg_hba.conf settings, nor set a password
during the initdb phase, I was surprised by this.
When I su'ed back to root, I was able to run the startup script the
package had put in /usr/local/etc/rc.d. But, this contradicts:
http://www.postgresql.org/docs/7.4/static/postmaster-start.html
Different systems have different conventions for starting up daemons
at boot time. Many systems have a file /etc/rc.local or
/etc/rc.d/rc.local. Others use 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:
I did check ps ax and found
pgsql 39212 0.0 0.4 6292 4376 ?? I 4:15PM 0:00.00
postmaster: stats
pgsql 39210 0.0 0.4 7280 4384 ?? I 4:15PM 0:00.00
postmaster: stats
pgsql 39206 0.0 0.4 15532 4460 ?? Is 4:15PM 0:00.02
/usr/local/bin/pos
which indicates the postmaster is running as the postgresql superuser.
So far, all seems okay, but I wanted to check to make sure this looked
okay. any comments?
--
David Bear
phone: 480-965-8257
fax: 480-965-9189
College of Public Programs/ASU
Wilson Hall 232
Tempe, AZ 85287-0803
"Beware the IP portfolio, everyone will be suspect of trespassing"
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: new install starting backend
@ 2004-08-18 03:44 Joe Sunday <sunday@csh.rit.edu>
parent: David Bear <David.Bear@asu.edu>
0 siblings, 0 replies; 2+ messages in thread
From: Joe Sunday @ 2004-08-18 03:44 UTC (permalink / raw)
To: David Bear <David.Bear@asu.edu>; +Cc: pgsql-admin
On Tue, Aug 17, 2004 at 04:23:02PM -0700, David Bear wrote:
> I installed postgres from the freebsd ports collection.
>
> Then, after doing the initdb, I tried to run the backend as the
> postgres user, ie while su'ed as pgsql. I was prompt for a password.
> Since I had not change and pg_hba.conf settings, nor set a password
> during the initdb phase, I was surprised by this.
>
> When I su'ed back to root, I was able to run the startup script the
> package had put in /usr/local/etc/rc.d. But, this contradicts:
>
> http://www.postgresql.org/docs/7.4/static/postmaster-start.html
>
> Different systems have different conventions for starting up daemons
> at boot time. Many systems have a file /etc/rc.local or
> /etc/rc.d/rc.local. Others use 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:
>
> I did check ps ax and found
>
> pgsql 39212 0.0 0.4 6292 4376 ?? I 4:15PM 0:00.00
> postmaster: stats
> pgsql 39210 0.0 0.4 7280 4384 ?? I 4:15PM 0:00.00
> postmaster: stats
> pgsql 39206 0.0 0.4 15532 4460 ?? Is 4:15PM 0:00.02
> /usr/local/bin/pos
>
> which indicates the postmaster is running as the postgresql superuser.
> So far, all seems okay, but I wanted to check to make sure this looked
> okay. any comments?
The startup script in the ports collection does the su for you.
If you try to run it as the postgres user, it will still attempt an su,
which since you aren't root will require the unix password for the
postgres account to execute. Run as root, su just works without needing
a password. So you're seeing the expected behaviour.
--Joe
--
Joe Sunday <sunday@csh.rit.edu> http://www.csh.rit.edu/~sunday/
Computer Science House, Rochester Inst. Of Technology
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-08-18 03:44 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-17 23:23 new install starting backend David Bear <David.Bear@asu.edu>
2004-08-18 03:44 ` Joe Sunday <sunday@csh.rit.edu>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox