This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [BUG] Bad File Descriptor while trying to set up postgresql


David A. Cobb schrieb:
At first, this stopped me entirely from initializing postgres; however, today the initdb & createdb succeeded -- I don't know what changed. In any case, references to the database directory during the initdb incur a Bad File Descriptor complaint when trying to set permissions.

The partition where the database lives is FAT32 -- it needs to be because it is also visible from my Linux dual-boot. I know permissions on a FAT32 volume are, at best, faked. But IMHO it shouldn't incur this sort of error.

Win95 or NT?


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

Running in debug mode.

initdb: internal variables:
  PGDATA=/var/database/pgsql
  datadir=/usr/share/postgresql
  PGPATH=/usr/bin
  ENCODING=UTF-8
  ENCODINGID=6
  POSTGRES_SUPERUSERNAME=postgres
  POSTGRES_BKI=/usr/share/postgresql/postgres.bki
  POSTGRES_DESCR=/usr/share/postgresql/postgres.description
  POSTGRESQL_CONF_SAMPLE=/usr/share/postgresql/postgresql.conf.sample
  PG_HBA_SAMPLE=/usr/share/postgresql/pg_hba.conf.sample
  PG_IDENT_SAMPLE=/usr/share/postgresql/pg_ident.conf.sample
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /var/database/pgsql... chmod: changing permissions of `/var/database/pgsql': Bad file descriptor

initdb: failed
total 0
drwxr-xr-x    2 postgres None            0 Aug  5 11:27 Debian_Packages
drwxr-xr-x    5 postgres None            0 Aug 25 13:25 Marathon
drwxr-xr-x    3 postgres None            0 Aug 25 11:22 Zeos
drwxr-xr-x    2 postgres None            0 Aug 25 22:24 pgsql

FAT is not supported.
See http://cygwin.com/cygwin-ug-net/highlights.html#OV-HI-PERM
Don't use the postgres user, use your own on FAT (file ownership doesn't work on FAT)


But this can be easily overcome since /bin/initdb is only a shell script.
find the line of your error: line 515

chmod go-rwx "$PGDATA" || exit_nicely

apply the needed permissions by yourself, comment it out and run again.
CYGWIN=ntea should help to fake perms on a FAT IMHO, but I am not sure.

BTW: cygcheck must accompony a real bug report.
So I cannot see your CYGWIN and OS environment.
See http://cygwin.com/problems.html

real postgres bug reports should also go to pgsql-bugs@postgresql.org, but the cygwin maintainer usually does that for you if he can verify that.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]