Re: Postgresql fails to start? (Update)

Lists: pgsql-general
From: Dianne Yumul <dianne(at)wellsgaming(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql fails to start? (Update)
Date: 2005-06-09 19:23:48
Message-ID: 8596f97934a684f4521e585e31b9b4a8@wellsgaming.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Just an update . . . I tried upgrading kernel to 2.6.11.11 (kernel.org)
but was unsuccessful (due to i2c and gcc 4.0 issue). So I settled for
the one on the fedora development repository. But that didn't help,
upgraded other stuff too like selinux-policy-targeted and initscripts.
Beginning to pull my hair out at this point.

Tried relabeling filesystem per selinux faq. Used fixfiles restore,
which looked promising because now ls -Z on my /home actually showed
some stuff. Now the big test:

# touch /home/postgres/pgstartup.log
# ls -Z /home/postgres/pgstartup.log
-rw-r--r-- root root
/home/postgres/pgstartup.log
# chown postgres:postgres /home/postgres/pgstartup.log
# chmod go-rwx /home/postgres/pgstartup.log
# chcon -u system_u -r object_r -t postgresql_log_t
/home/postgres/pgstartup.log
chcon: can't apply partial context to unlabeled file
/home/postgres/pgstartup.log
# ls -Z /home/postgres/pgstartup.log
-rw------- postgres postgres
/home/postgres/pgstartup.log

Argh . . . But found this odd thing while googling:

# touch /home/postgres/pgstartup.log
# ls -Z /home/postgres/pgstartup.log
-rw-r--r-- root root
/home/postgres/pgstartup.log
# chown postgres:postgres /home/postgres/pgstartup.log
# chmod go-rwx /home/postgres/pgstartup.log
# chcon system_u:object_r:postgresql_log_t /home/postgres/pgstartup.log
# ls -Z /home/postgres/pgstartup.log
-rw------- postgres postgres system_u:object_r:postgresql_log_t
/home/postgres/pgstartup.log

Voila, it works. I kind of have to move on now. Since this is just a
development box, this will do for now. When the final Fedora Core 4
comes out will install that and see what happens.

Thank very much again for the great help.

dianne


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dianne Yumul <dianne(at)wellsgaming(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql fails to start? (Update)
Date: 2005-06-09 20:27:08
Message-ID: 27453.1118348828@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Dianne Yumul <dianne(at)wellsgaming(dot)com> writes:
> # chcon -u system_u -r object_r -t postgresql_log_t
> /home/postgres/pgstartup.log
> chcon: can't apply partial context to unlabeled file
> /home/postgres/pgstartup.log
> [but this works:]
> # chcon system_u:object_r:postgresql_log_t /home/postgres/pgstartup.log

That's pretty interesting --- I'd say it's a flat-out bug in the FC4
version of chcon. Filed as
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=159973

I'm not sure whether the quickest fix from a Red Hat POV is to fix chcon
or just alter the initscript for Postgres. But certainly your best bet
to have something working today is to edit the initscript. Or of course
you can just manually create the file with the right context ...

regards, tom lane