diff mbox

[1/2] Set PGROOT dir owner to be "postgres".

Message ID 1457296152-4047-1-git-send-email-alan@tkos.co.il
State Superseded
Headers show

Commit Message

Alan Yaniger March 6, 2016, 8:29 p.m. UTC
Without setting the owner of /var/lib/pgsql to the user "postgres", 
the postgres server fails to start on boot.

Signed-off-by: Alan Yaniger <alan@tkos.co.il>
---
 package/postgresql/postgresql.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Baruch Siach March 7, 2016, 4:51 a.m. UTC | #1
Hi Alan,

On Sun, Mar 06, 2016 at 10:29:09PM +0200, Alan Yaniger wrote:
> Without setting the owner of /var/lib/pgsql to the user "postgres", 
> the postgres server fails to start on boot.
> 
> Signed-off-by: Alan Yaniger <alan@tkos.co.il>
> ---
>  package/postgresql/postgresql.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> index 444c1b1..5906ce9 100644
> --- a/package/postgresql/postgresql.mk
> +++ b/package/postgresql/postgresql.mk
> @@ -17,6 +17,10 @@ POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \
>  POSTGRESQL_AUTORECONF = YES
>  POSTGRESQL_CONF_OPTS = --disable-rpath
>  
> +define POSTGRESQL_PERMISSIONS
> +	/var/lib/pgsql d 755 postgres postgres - - - - -
> +endef

A better place for this IMO would be near POSTGRESQL_USERS below.

Thanks,
baruch
Baruch Siach March 7, 2016, 5:40 a.m. UTC | #2
Hi Alan,

On Mon, Mar 07, 2016 at 06:51:42AM +0200, Baruch Siach wrote:
> On Sun, Mar 06, 2016 at 10:29:09PM +0200, Alan Yaniger wrote:
> > Without setting the owner of /var/lib/pgsql to the user "postgres", 
> > the postgres server fails to start on boot.
> > 
> > Signed-off-by: Alan Yaniger <alan@tkos.co.il>
> > ---
> >  package/postgresql/postgresql.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> > index 444c1b1..5906ce9 100644
> > --- a/package/postgresql/postgresql.mk
> > +++ b/package/postgresql/postgresql.mk
> > @@ -17,6 +17,10 @@ POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \
> >  POSTGRESQL_AUTORECONF = YES
> >  POSTGRESQL_CONF_OPTS = --disable-rpath
> >  
> > +define POSTGRESQL_PERMISSIONS
> > +	/var/lib/pgsql d 755 postgres postgres - - - - -
> > +endef
> 
> A better place for this IMO would be near POSTGRESQL_USERS below.

One more comment that I forgot: patch subject line should not end with a full 
stop.

I believe that the maintainer applying these patches can fix those minor 
issues while applying, so unless someone else finds bigger issues with these 
patches you do not need to resend.

baruch
Thomas Petazzoni March 7, 2016, 8:29 a.m. UTC | #3
Hello,

On Mon, 7 Mar 2016 06:51:42 +0200, Baruch Siach wrote:

> On Sun, Mar 06, 2016 at 10:29:09PM +0200, Alan Yaniger wrote:
> > Without setting the owner of /var/lib/pgsql to the user "postgres", 
> > the postgres server fails to start on boot.
> > 
> > Signed-off-by: Alan Yaniger <alan@tkos.co.il>
> > ---
> >  package/postgresql/postgresql.mk | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> > index 444c1b1..5906ce9 100644
> > --- a/package/postgresql/postgresql.mk
> > +++ b/package/postgresql/postgresql.mk
> > @@ -17,6 +17,10 @@ POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \
> >  POSTGRESQL_AUTORECONF = YES
> >  POSTGRESQL_CONF_OPTS = --disable-rpath
> >  
> > +define POSTGRESQL_PERMISSIONS
> > +	/var/lib/pgsql d 755 postgres postgres - - - - -
> > +endef
> 
> A better place for this IMO would be near POSTGRESQL_USERS below.

Well, there is already a POSTGRESQL_USERS:

define POSTGRESQL_USERS
        postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
endef

And this should already create /var/lib/pgsql, owned by the
postgres:postgres user.

Best regards,

Thomas
Alan Yaniger March 9, 2016, 9:21 a.m. UTC | #4
Hi Thomas,

I see what my error was. I installed the rootfs on my SSD by copying
it from a partition on a USB-disk which I had mounted. Then I ran "cp"
to copy from the mounted partition to the SSD, and I forgot to use the -p
option to preserve attributes. When I installed after the "fix", I used "tar" to
install, which preserved the ownership.

I changed the state of the patch to "Rejected" in Patchwork.

Alan

On 07/03/16 09:29, Thomas Petazzoni wrote:
> Hello,
> 
> On Mon, 7 Mar 2016 06:51:42 +0200, Baruch Siach wrote:
> 
> > On Sun, Mar 06, 2016 at 10:29:09PM +0200, Alan Yaniger wrote:
> > > Without setting the owner of /var/lib/pgsql to the user "postgres", 
> > > the postgres server fails to start on boot.
> > > 
> > > Signed-off-by: Alan Yaniger <alan@tkos.co.il>
> > > ---
> > >  package/postgresql/postgresql.mk | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
> > > index 444c1b1..5906ce9 100644
> > > --- a/package/postgresql/postgresql.mk
> > > +++ b/package/postgresql/postgresql.mk
> > > @@ -17,6 +17,10 @@ POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \
> > >  POSTGRESQL_AUTORECONF = YES
> > >  POSTGRESQL_CONF_OPTS = --disable-rpath
> > >  
> > > +define POSTGRESQL_PERMISSIONS
> > > +	/var/lib/pgsql d 755 postgres postgres - - - - -
> > > +endef
> > 
> > A better place for this IMO would be near POSTGRESQL_USERS below.
> 
> Well, there is already a POSTGRESQL_USERS:
> 
> define POSTGRESQL_USERS
>         postgres -1 postgres -1 * /var/lib/pgsql /bin/sh - PostgreSQL Server
> endef
> 
> And this should already create /var/lib/pgsql, owned by the
> postgres:postgres user.
> 
> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Thomas Petazzoni March 9, 2016, 12:15 p.m. UTC | #5
Alan,

On Wed, 9 Mar 2016 11:21:49 +0200, Alan Yaniger wrote:

> I see what my error was. I installed the rootfs on my SSD by copying
> it from a partition on a USB-disk which I had mounted. Then I ran "cp"
> to copy from the mounted partition to the SSD, and I forgot to use the -p
> option to preserve attributes. When I installed after the "fix", I used "tar" to
> install, which preserved the ownership.

OK.

> I changed the state of the patch to "Rejected" in Patchwork.

Thanks for following up and changing the state of your patch!

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index 444c1b1..5906ce9 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -17,6 +17,10 @@  POSTGRESQL_CONF_ENV = ac_cv_type_struct_sockaddr_in6=yes \
 POSTGRESQL_AUTORECONF = YES
 POSTGRESQL_CONF_OPTS = --disable-rpath
 
+define POSTGRESQL_PERMISSIONS
+	/var/lib/pgsql d 755 postgres postgres - - - - -
+endef
+
 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
 # PostgreSQL does not build against uClibc with locales
 # enabled, due to an uClibc bug, see