How to give permission to others on data directory

Started by Amit Kharealmost 24 years ago5 messages
#1Amit Khare
skamit2000@yahoo.com

Hi All,

Recently we got into problem of giving permission to data directory.

(1) Actually we are doing project on PostgreSQL in group of two. We installed individual copy of PostgreSQL into our group directory.
(2) When I created data directory and ran "initdb" it makes me( takes my login name ) as the owner of data directory.
(3) The problem is that now my partner cannot start the postmaster since he does not have right on the data directory. Further one cannot set right on the data directory more than 700 .
(4) For time being we hacked the postmaster.c and commented the line starting from 318 which actually test the permission on data directory. Then my partner was able to run the postmaster since now I gave him rights(770) on the data directory(But changed rights on postgresql.conf file to 744).

(5) Is there a clean way by which my partner can start postmaster on data directory created by me.

Thanks and Regards

Amit Khare

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Amit Khare (#1)
Re: How to give permission to others on data directory

Amit Khare writes:

(1) Actually we are doing project on PostgreSQL in group of two. We installed individual copy of PostgreSQL into our group directory.
(2) When I created data directory and ran "initdb" it makes me( takes my login name ) as the owner of data directory.
(3) The problem is that now my partner cannot start the postmaster since he does not have right on the data directory. Further one cannot set right on the data directory more than 700 .
(4) For time being we hacked the postmaster.c and commented the line starting from 318 which actually test the permission on data directory. Then my partner was able to run the postmaster since now I gave him rights(770) on the data directory(But changed rights on postgresql.conf file to 744).

(5) Is there a clean way by which my partner can start postmaster on data directory created by me.

Create a separate user for the server and give yourself and your partner
access to it.

--
Peter Eisentraut peter_e@gmx.net

#3Amit Khare
skamit2000@yahoo.com
In reply to: Peter Eisentraut (#2)
Re: How to give permission to others on data directory

Hi Peter,
Thank you very much for your reply .
However the problem is that we don't want to create separate user for
server. If "initdb" takes my login name and makes me owner of the data
directory then how should I be able to give permission to other users in
this case my project partner?

Thanks again

Regards
Amit Khare
----- Original Message -----
From: Peter Eisentraut <peter_e@gmx.net>
To: Amit Khare <skamit2000@yahoo.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Sunday, March 31, 2002 4:20 AM
Subject: Re: [HACKERS] How to give permission to others on data directory

Amit Khare writes:

(1) Actually we are doing project on PostgreSQL in group of two. We

installed individual copy of PostgreSQL into our group directory.

(2) When I created data directory and ran "initdb" it makes me( takes my

login name ) as the owner of data directory.

(3) The problem is that now my partner cannot start the postmaster since

he does not have right on the data directory. Further one cannot set right
on the data directory more than 700 .

(4) For time being we hacked the postmaster.c and commented the line

starting from 318 which actually test the permission on data directory. Then
my partner was able to run the postmaster since now I gave him rights(770)
on the data directory(But changed rights on postgresql.conf file to 744).

(5) Is there a clean way by which my partner can start postmaster on

data directory created by me.

Create a separate user for the server and give yourself and your partner
access to it.

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

#4David Walker
dwalker@vorteon.com
In reply to: Amit Khare (#3)
Re: How to give permission to others on data directory

Create a separate user and both of you use sudo to start the database.
If you're insistent on keeping yourself owner of the data then use sudo to
give permission to your project partner to start the database.

Show quoted text

On Sunday 31 March 2002 05:49 am, Amit Khare wrote:

Hi Peter,
Thank you very much for your reply .
However the problem is that we don't want to create separate user for
server. If "initdb" takes my login name and makes me owner of the data
directory then how should I be able to give permission to other users in
this case my project partner?

Thanks again

Regards
Amit Khare
----- Original Message -----
From: Peter Eisentraut <peter_e@gmx.net>
To: Amit Khare <skamit2000@yahoo.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Sunday, March 31, 2002 4:20 AM
Subject: Re: [HACKERS] How to give permission to others on data directory

Amit Khare writes:

(1) Actually we are doing project on PostgreSQL in group of two. We

installed individual copy of PostgreSQL into our group directory.

(2) When I created data directory and ran "initdb" it makes me( takes
my

login name ) as the owner of data directory.

(3) The problem is that now my partner cannot start the postmaster
since

he does not have right on the data directory. Further one cannot set right
on the data directory more than 700 .

(4) For time being we hacked the postmaster.c and commented the line

starting from 318 which actually test the permission on data directory.
Then my partner was able to run the postmaster since now I gave him
rights(770) on the data directory(But changed rights on postgresql.conf
file to 744).

(5) Is there a clean way by which my partner can start postmaster on

data directory created by me.

Create a separate user for the server and give yourself and your partner
access to it.

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

#5David Walker
pgsql@grax.com
In reply to: David Walker (#4)
Re: How to give permission to others on data directory

Create a separate user and both of you use sudo to start the database.
If you're insistent on keeping yourself owner of the data then use sudo to
give permission to your project partner to start the database.

On Sunday 31 March 2002 05:49 am, Amit Khare wrote:

Hi Peter,
Thank you very much for your reply .
However the problem is that we don't want to create separate user for
server. If "initdb" takes my login name and makes me owner of the data
directory then how should I be able to give permission to other users in
this case my project partner?

Thanks again

Regards
Amit Khare
----- Original Message -----
From: Peter Eisentraut <peter_e@gmx.net>
To: Amit Khare <skamit2000@yahoo.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Sunday, March 31, 2002 4:20 AM
Subject: Re: [HACKERS] How to give permission to others on data directory

Amit Khare writes:

(1) Actually we are doing project on PostgreSQL in group of two. We

installed individual copy of PostgreSQL into our group directory.

(2) When I created data directory and ran "initdb" it makes me( takes
my

login name ) as the owner of data directory.

(3) The problem is that now my partner cannot start the postmaster
since

he does not have right on the data directory. Further one cannot set right
on the data directory more than 700 .

(4) For time being we hacked the postmaster.c and commented the line

starting from 318 which actually test the permission on data directory.
Then my partner was able to run the postmaster since now I gave him
rights(770) on the data directory(But changed rights on postgresql.conf
file to 744).

(5) Is there a clean way by which my partner can start postmaster on

data directory created by me.

Create a separate user for the server and give yourself and your partner
access to it.

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

-------------------------------------------------------