Re: Question: script to start DB on server reboot

From: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>
To: "pgsql-general (at) postgresql (dot) org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question: script to start DB on server reboot
Date: 2003-06-12 08:52:09
Message-ID: 20030612095209.C27376@bacon
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 09/06/2003 07:40 Aurangzeb M. Agha wrote:

> I have a site hosted by an ISP which, for one reason or another, often
> needs to restart their server after upgrades, maintenance, etc... When
> this happens, I need a script to restart my server and my Java processes.
> While I've got the entire script written, I'm having a major problem
> getting the DB to start up due to the permissions on the DB dir.
>
> The dir out of which my application is served has the following contents:
>
> drwxr-xr-x 9 admin admin 4096 Mar 30 14:22 .
> drwxr-xr-x 3 admin admin 4096 Mar 31 08:58 ..
> drwx------ 6 postgres postgres 4096 May 19 20:55 DB
> drwxr-xr-x 5 admin admin 4096 Mar 29 02:01 backup
> ...
> drwxr-xr-x 3 admin admin 4096 Mar 28 23:06 lib
>
> Note that my DB dir has 700 permissions for the Postgres user and group.
> This has made it impossible for me to effect any change in this dir when
> the script runs--the script is run on startup by the admin user (this is
> requirement due to the setup by the ISP, and I don't have the power to
> run
> the script as root).
>
> What I need to do is very simple. Before I start any of my other
> processes (Java, Apache, etc...), I want to start up the DB:
>
> 1. Remove postmaster.pid if it exists
> 2. Backup the existing log file
> 3. Start the DB
>
> However, I can't even get into the dir due to its permission structure.
> Is my permission structure for the DB incorrect?
>

Maybe you could get your admin user added to postgres's group then use
0770 permissions for your postgres directory tree. I think that would work.

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+

In response to

Browse pgsql-general by date

  From Date Subject
Next Message mogas 2003-06-12 09:16:13
Previous Message Nigel J. Andrews 2003-06-12 08:33:59 Re: bad unicode characters