Обсуждение: BUG #5430: initdb fails due to permissions of /usr/share/pgsql
The following bug has been logged online: Bug reference: 5430 Logged by: Jamie Strachan Email address: frostfreek@yahoo.com PostgreSQL version: 8.4.3-2PGDG.el4 Operating system: CentOS 4 Description: initdb fails due to permissions of /usr/share/pgsql Details: Hello, Downloaded the following RPM: http://yum.pgsqlrpms.org/8.4/redhat/rhel-4-i386/postgresql-server-8.4.3-2PGD G.el4.i386.rpm for my CentOS 4 install. service postgresql initdb fails with no error message. So, I su'd to postgres, and ran initdb --pgdata=/var/lib/pgsql/data --auth=ident which is what service postgresql initdb does. This command failed, with the error message: could not open directory "/usr/share/pgsql/timezonesets" I did a chown -R postgres:postgres /usr/share/pgsql and then it worked fine. Using rpm2cpio {file} | cpio -tv I see: drwxr-xr-x 6 root root 0 Mar 17 16:21 ./usr/share/pgsql which is fine, however there is no specific entry for /usr/share/timezone. The post-install script doesn't seem to fix it, either.
Would you report this to the RPM maintainers? --------------------------------------------------------------------------- Jamie Strachan wrote: > > The following bug has been logged online: > > Bug reference: 5430 > Logged by: Jamie Strachan > Email address: frostfreek@yahoo.com > PostgreSQL version: 8.4.3-2PGDG.el4 > Operating system: CentOS 4 > Description: initdb fails due to permissions of /usr/share/pgsql > Details: > > Hello, > > Downloaded the following RPM: > http://yum.pgsqlrpms.org/8.4/redhat/rhel-4-i386/postgresql-server-8.4.3-2PGD > G.el4.i386.rpm > > for my CentOS 4 install. > > service postgresql initdb fails with no error message. > > So, I su'd to postgres, and ran > > initdb --pgdata=/var/lib/pgsql/data --auth=ident > which is what service postgresql initdb does. > This command failed, with the error message: > > could not open directory "/usr/share/pgsql/timezonesets" > > > I did a > chown -R postgres:postgres /usr/share/pgsql > and then it worked fine. > > Using rpm2cpio {file} | cpio -tv > I see: > drwxr-xr-x 6 root root 0 Mar 17 16:21 ./usr/share/pgsql > which is fine, however there is no specific entry for > /usr/share/timezone. > The post-install script doesn't seem to fix it, either. > > -- > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-bugs -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com
Affirmative... Jamie Strachan ----- Original Message ---- From: Bruce Momjian <bruce@momjian.us> To: Jamie Strachan <frostfreek@yahoo.com> Cc: pgsql-bugs@postgresql.org Sent: Tue, April 20, 2010 11:29:57 AM Subject: Re: [BUGS] BUG #5430: initdb fails due to permissions of /usr/share/pgsql Would you report this to the RPM maintainers? --------------------------------------------------------------------------- Jamie Strachan wrote: > > The following bug has been logged online: > > Bug reference: 5430 > Logged by: Jamie Strachan > Email address: frostfreek@yahoo.com > PostgreSQL version: 8.4.3-2PGDG.el4 > Operating system: CentOS 4 > Description: initdb fails due to permissions of /usr/share/pgsql > Details: > > Hello, > > Downloaded the following RPM: > http://yum.pgsqlrpms.org/8.4/redhat/rhel-4-i386/postgresql-server-8.4.3-2PGD > G.el4.i386.rpm > > for my CentOS 4 install. > > service postgresql initdb fails with no error message. > > So, I su'd to postgres, and ran > > initdb --pgdata=/var/lib/pgsql/data --auth=ident > which is what service postgresql initdb does. > This command failed, with the error message: > > could not open directory "/usr/share/pgsql/timezonesets" > > > I did a > chown -R postgres:postgres /usr/share/pgsql > and then it worked fine. > > Using rpm2cpio {file} | cpio -tv > I see: > drwxr-xr-x 6 root root 0 Mar 17 16:21 ./usr/share/pgsql > which is fine, however there is no specific entry for > /usr/share/timezone. > The post-install script doesn't seem to fix it, either. > > -- > Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-bugs -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com
Hi, On Mon, 2010-04-19 at 14:22 +0000, Jamie Strachan wrote: > > for my CentOS 4 install. > > service postgresql initdb fails with no error message. > > So, I su'd to postgres, and ran > > initdb --pgdata=/var/lib/pgsql/data --auth=ident > which is what service postgresql initdb does. > This command failed, with the error message: > > could not open directory "/usr/share/pgsql/timezonesets" Cannot reproduce it on my 8.4+CentOS 4 box: -bash-3.00$ initdb --pgdata=/var/lib/pgsql/data --auth=ident ... Success. You can now start the database server using: ... timezonesets directory has already *enough* permissions for postgres user to read it: drwxr-xr-x 2 root root 4096 2010-03-19 09:45 timezonesets Are you sure that you did not chmod somewhere between installing package and initdb'ing? Regards, -- Devrim GÜNDÜZ PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz
I have posted the bug to the RPM maintainers, over at Command Prompt. So, 5430 can be closed. This is affecting my CentOS 4 release. (I have to support RHEL/CentOS 4, 5, and some others too.) [root@isotest ~]# more /etc/redhat-release=20 Red Hat Enterprise Linux ES release 4 (Nahant Update 3) [root@isotest ~]# rpm -e postgresql-server [root@isotest ~]# rm -fr /usr/share/pgsql/ [root@isotest ~]# rpm -i postgresql-server-8.4.3-2PGDG.el4.i386.rpm=20 warning: postgresql-server-8.4.3-2PGDG.el4.i386.rpm: V3 DSA signature: NOKE= Y, key ID e8e345b8 [root@isotest ~]# ls -ld /usr/share/pgsql/timezone drwxr-x--- 19 root root 4096 Apr 20 16:27 /usr/share/pgsql/timezone [root@isotest ~]# ls -ld /usr/share/pgsql/timezonesets/ drwxr-x--- 2 root root 4096 Apr 20 16:27 /usr/share/pgsql/timezonesets/ other is denied access. Thanks, Jamie Strachan. ----- Original Message ---- From: Devrim G=C3=9CND=C3=9CZ <devrim@gunduz.org> To: Jamie Strachan <frostfreek@yahoo.com> Cc: pgsql-bugs@postgresql.org Sent: Tue, April 20, 2010 3:38:05 PM Subject: Re: [BUGS] BUG #5430: initdb fails due to permissions of /usr/shar= e/pgsql Hi, On Mon, 2010-04-19 at 14:22 +0000, Jamie Strachan wrote: >=20 > for my CentOS 4 install. >=20 > service postgresql initdb fails with no error message. >=20 > So, I su'd to postgres, and ran >=20 > initdb --pgdata=3D/var/lib/pgsql/data --auth=3Dident > which is what service postgresql initdb does. > This command failed, with the error message: >=20 > could not open directory "/usr/share/pgsql/timezonesets"=20 Cannot reproduce it on my 8.4+CentOS 4 box: -bash-3.00$ initdb --pgdata=3D/var/lib/pgsql/data --auth=3Dident ... Success. You can now start the database server using: ... timezonesets directory has already *enough* permissions for postgres user to read it: drwxr-xr-x 2 root root 4096 2010-03-19 09:45 timezonesets Are you sure that you did not chmod somewhere between installing package and initdb'ing? Regards, --=20 Devrim G=C3=9CND=C3=9CZ PostgreSQL Dan=C4=B1=C5=9Fman=C4=B1/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz
On Tue, 2010-04-20 at 13:39 -0700, Jamie Strachan wrote: > [root@isotest ~]# ls -ld /usr/share/pgsql/timezonesets/ > drwxr-x--- 2 root root 4096 Apr 20 > 16:27 /usr/share/pgsql/timezonesets/ Still, this should have never ever happened. Lacey, AFAICS there is nothing that could cause this issue in your spec file. > # more /etc/redhat-release > Red Hat Enterprise Linux ES release 4 (Nahant Update 3) Mine is Update 8, BTW. I wonder whether there is an bug related to rpm itself in here. -- Devrim GÜNDÜZ PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer PostgreSQL RPM Repository: http://yum.pgrpms.org Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz
Hello, I do appreciate help on this issue! It seems to me that the directories /usr/share/pgsql/tsearch_data timezone = and timezone_data - are not explicitly contained within in the RPM - are not configured by %defattr (defattr is -,root,root) I did a quick search to see what the default behaviour is supposed to be wh= en a directory is not explicitly configured, but came up empty so far. Sure enough, I have duplicated this scenario with a simple test RPM. CentOS 5 [root@localhost ~]# rpm -i testy-1.0.0-0.noarch.rpm=20 [root@localhost ~]# ls -ld /opt/counterpath/eas/test drwxr-xr-x 2 root root 4096 Apr 21 09:00 /opt/counterpath/eas/test 5 CentOS 4 [root@isotest ~]# rpm2cpio testy-1.0.0-0.noarch.rpm | cpio -tv -rw-r--r-- 1 root root 6 Apr 21 08:53 ./opt/counterpath/ea= s/test/testfile.txt 1 block [root@isotest ~]# rpm -i testy-1.0.0-0.noarch.rpm=20 [root@isotest ~]# ls -ld /opt/counterpath/eas/test drwxr-x--- 2 root root 4096 Apr 21 08:59 /opt/counterpath/eas/test CentOS 5 installs the directory with drwxr-xr-x, whereas CentOS4 installs i= t with drwxr-x--- I don't think there should be any issue with explicitly specifying the dire= ctory in the RPM with a %dir directive. EG.,=20 %dir %attr(0755,root,root) /opt/counterpath/eas/test My test RPM now installs properly on CentOS 4: [root@isotest nortel]# rpm2cpio testy-1.0.0-0.noarch.rpm | cpio -tv drwxr-xr-x 2 root root 0 Apr 21 08:53 ./opt/counterpath/ea= s/test -rw-r--r-- 1 root root 6 Apr 21 08:53 ./opt/counterpath/ea= s/test/testfile.txt 1 block [root@isotest nortel]# rpm -i testy-1.0.0-0.noarch.rpm=20 [root@isotest nortel]# ls -ld /opt/counterpath/eas/test drwxr-xr-x 2 root root 4096 Apr 21 09:14 /opt/counterpath/eas/test Again, thank you for your time!!! Jamie Strachan