Re: Restarting, ownership, and permissions

From: Richard Huxton <dev(at)archonet(dot)com>
To: ama-list(at)mltp(dot)com, PostgreSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Restarting, ownership, and permissions
Date: 2003-09-02 21:21:35
Message-ID: 200309022221.35600.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tuesday 02 September 2003 21:51, Aurangzeb M. Agha wrote:
> I run my Postgres DB on a virtual linux server where I don't have root.
> I'm 'admin', by default, and have created a 'postgres' user to own the DB
> dir.
>
> My problem is that on occassion, my ISP restarts my server, stranding all
> my processes. While I have scripts to restart Apache and my Servlet
> engine on reboot, I don't know how to get the Postgres DB up and running
> again. The main problem is that the dir is owned (postgres.postgres) and
> chmod'd to 700, keeping anyone but the 'postgres' user from starting it
> up.
>
> I tried chownin'g the DB dir to postgres.admin, and chmodding to 770, but
> when I tried to start the DB, I got a fatal error in the log indicating
> that postgres must own the dir, and the permissions must be u=rwx. What
> can I do?

Hmm - so you can't "su - postgres" because as "admin" you'll need a password.
Off the top of my head you could:

1. chmod PG's startup script, so it runs suid as postgres (chmod u+s)
2. Use ssh to login as user postgres on localhost and execute pg_ctl start
(you can setup ssh so it doesn't need a password)

Either of those should work, with a little effort.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aaron 2003-09-02 21:26:04 web hosting postgres
Previous Message Jonathan Bartlett 2003-09-02 21:10:05 Re: About GPL and proprietary software