1

Temat: Konfiguracja Posgresql na Fedora 11

Podsumowanie

SELinux is preventing postmaster (postgresql_t) "append" to /var/lib/pgsql/pgstartup.log (var_lib_t).

Szczegółowy opis

SELinux denied access requested by postmaster. /var/lib/pgsql/pgstartup.log may be a mislabeled. /var/lib/pgsql/pgstartup.log default SELinux type is postgresql_log_t, but its current type is var_lib_t. Changing this file back to the default type, may fix your problem.

File contexts can be assigned to a file in the following ways.
Files created in a directory receive the file context of the parent directory by default.
The SELinux policy might override the default label inherited from the parent directory by specifying a process running in context A which creates a file in a directory labeled B will instead create the file with label C. An example of this would be the dhcp client running with the dhclient_t type and creates a file in the directory /etc. This file would normally receive the etc_t type due to parental inheritance but instead the file is labeled with the net_conf_t type because the SELinux policy specifies this.
Users can change the file context on a file using tools such as chcon, or restorecon.

This file could have been mislabeled either by user error, or if an normally confined application was run under the wrong domain.

However, this might also indicate a bug in SELinux because the file should not have been labeled with this type.

If you believe this is a bug, please file a bug report against this package.

Zezwalanie na dostęp
You can restore the default system context to this file by executing the restorecon command. restorecon '/var/lib/pgsql/pgstartup.log', if this file is a directory, you can recursively restore using restorecon -R '/var/lib/pgsql/pgstartup.log'.
Polecenie naprawyrestorecon '/var/lib/pgsql/pgstartup.log'
Dodatkowe informacje
Kontekst źródłowy:  unconfined_u:system_r:postgresql_t:s0
Kontekst docelowy:  unconfined_u:object_r:var_lib_t:s0
Obiekty docelowe:  /var/lib/pgsql/pgstartup.log [ file ]
Źródło:  initdb
Ścieżka źródłowa:  /usr/bin/initdb
Port:  <Nieznane>
Komputer:  majkel-linux
Źródłowe pakiety RPM:  postgresql-server-8.3.7-1.fc11
Docelowe pakiety RPM: 
RPM polityki:  selinux-policy-3.6.12-80.fc11
SELinux jest włączony:  True
Typ polityki:  targeted
MLS jest włączone:  True
Tryb wymuszania:  Enforcing
Nazwa wtyczki:  restorecon
Nazwa komputera:  majkel-linux
Platforma:  Linux majkel-linux 2.6.29.6-217.2.16.fc11.x86_64 #1 SMP Mon Aug 24 17:17:40 EDT 2009 x86_64 x86_64
Licznik alarmów:  20
Po raz pierwszy:  wto, 1 wrz 2009, 23:01:29
Po raz ostatni:  czw, 3 wrz 2009, 11:03:36
Lokalny identyfikator:  d6c8223a-26b8-4b38-9497-aa026e7b51da
Liczba wierszy:  

Surowe komunikaty audytu :

node=majkel-linux type=AVC msg=audit(1251968616.886:39): avc: denied { append } for pid=3699 comm="postmaster" path="/var/lib/pgsql/pgstartup.log" dev=dm-0 ino=188936 scontext=unconfined_u:system_r:postgresql_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file node=majkel-linux type=AVC msg=audit(1251968616.886:39): avc: denied { append } for pid=3699 comm="postmaster" path="/var/lib/pgsql/pgstartup.log" dev=dm-0 ino=188936 scontext=unconfined_u:system_r:postgresql_t:s0 tcontext=unconfined_u:object_r:var_lib_t:s0 tclass=file node=majkel-linux type=SYSCALL msg=audit(1251968616.886:39): arch=c000003e syscall=59 success=yes exit=0 a0=1bef6d0 a1=1bf1220 a2=1bf6050 a3=30 items=0 ppid=1 pid=3699 auid=500 uid=26 gid=26 euid=26 suid=26 fsuid=26 egid=26 sgid=26 fsgid=26 tty=(none) ses=1 comm="postmaster" exe="/usr/bin/postgres" subj=unconfined_u:system_r:postgresql_t:s0 key=(null)

Ostatnio edytowany przez hardcorek (2009-09-03 12:37:12)

2

Odp: Konfiguracja Posgresql na Fedora 11

3

Odp: Konfiguracja Posgresql na Fedora 11

4

Odp: Konfiguracja Posgresql na Fedora 11

A sprawdziłeś czy są takie pliki jak  /usr/local/pgsql/bin/pg_ctl i /usr/local/pgsql/bin/initdb ?

5

Odp: Konfiguracja Posgresql na Fedora 11

Nie ma ich. Kurcze, tak do niczego nie dojdziemy. Czy może mi ktoś napisać krok po kroku jak skonfigurować po zainstalowaniu z pakietów? Nie wiem co powinno być, miałem nadzieję, że instalacja będzie automatyczna a ja tylko dodam użytkownika, jednak jest to nieco bardziej skomplikowane. :-(

6

Odp: Konfiguracja Posgresql na Fedora 11

1) Przede wszystkim wyszukaj sobie gdzie są te pliki (niestety każda dystrybucja ma swoje miejsce ich składowania)
tutaj w tutorialu miałes że sa w /usr/local/pgsql u ciebie są gdzieś indziej
2) Jak juz znajdziesz te pliki i założysz sobie użytkownika, i utworzysz katalog data (czy jak go tam nazwiesz) i nadasz prawa to pamietaj aby sobie ustawic zmienna PGDATA wskazujac ja na katalog który utworzysz.
3) Najlepiej jak dojdziesz dd sytuacji gdy wpisujac np polecenie

initdb

nie dostaniesz komunikatu nieznane polecenie.
4) Potem juz bedzie z górki.

Jakbys mial z czyms problem to wal.

7

Odp: Konfiguracja Posgresql na Fedora 11

find / -name initdb