Description of problem: Installing the postgresql-server package does not create the postgres sql user Version-Release number of selected component (if applicable): 8.1.3-1 How reproducible: Allways Steps to Reproduce: 1. yum groupinstall "PostgreSQL Database" 2. /etc/init.d/postgresql restart 3. Actual results: From Yum... Installing: postgresql-server ######################## [5/7]warning: user postgres does not exist - using root warning: group postgres does not exist - using root Installing: postgresql-server ######################## [5/7]warning: user postgres does not exist - using root warning: group postgres does not exist - using root Installing: postgresql-server ######################## [5/7]warning: user postgres does not exist - using root warning: group postgres does not exist - using root Installing: postgresql-server ######################## [5/7]warning: user postgres does not exist - using root warning: group postgres does not exist - using root When Trying to start postgres Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists chown: `postgres:postgres': invalid user [FAILED] Starting postgresql service: [FAILED] Expected results: User gets created, Server starts Additional info: Fresh install of fc5, with all present updates applied.
The RPM certainly tries to create that user --- its "%pre server" script does groupadd -g 26 -o -r postgres useradd -M -n -g postgres -o -r -d /var/lib/pgsql -s /bin/bash -c "PostgreSQL Server" -u 26 postgres I notice it ignores any errors from them though :-( ... probably to deal with the case where the user and group already exist. What happens if you try to do those commands by hand (as root)?
When i remove the server packages, manualy add the user, and then reinstall the server packages, it works. The package manages to create the group, but not the user, it manages to remove both group and user on uninstall.
Additonly starting the server generates the following selinux errors, Apr 30 08:02:42 newsilver kernel: audit(1146380562.762:16): avc: denied { append } for pid=3301 comm="hostname" name="pgstartup.log" dev=sda3 ino=13978277 scontext =user_u:system_r:hostname_t:s0 tcontext=system_u:object_r:postgresql_log_t:s0 tclass=file Apr 30 08:02:42 newsilver kernel: audit(1146380562.794:17): avc: denied { append } for pid=3316 comm="hostname" name="pgstartup.log" dev=sda3 ino=13978277 scontext =user_u:system_r:hostname_t:s0 tcontext=system_u:object_r:postgresql_log_t:s0 tclass=file Apr 30 08:02:46 newsilver kernel: audit(1146380566.416:18): avc: denied { append } for pid=3367 comm="hostname" name="pgstartup.log" dev=sda3 ino=13978277 scontext =user_u:system_r:hostname_t:s0 tcontext=system_u:object_r:postgresql_log_t:s0 tclass=file Apr 30 08:02:46 newsilver kernel: audit(1146380566.448:19): avc: denied { append } for pid=3382 comm="hostname" name="pgstartup.log" dev=sda3 ino=13978277 scontext =user_u:system_r:hostname_t:s0 tcontext=system_u:object_r:postgresql_log_t:s0 tclass=file
Hm ... I'm baffled but am thinking SELinux might have blocked the initial useradd step somehow. Dan, any troubleshooting suggestions?
I dont think so, the selinux errrors only apear when you actualy start the server.
Were there any AVC messages during the install?
Nope, no messages during the install.
Right, After having a simular problem trying to install a differant package (openldap-servers) I've taken a closer look at this machine. I think the problem may be due to the login.defs file being tweaked on this machine. Replaceing the tweaked login.defs with the .rpmnew version made the problem go away for openldap-server, and i suspect it will do the same for postgresql.
Would you confirm whether or not that was the problem? I'd like to close this bug if it was just a problem with a broken login.defs file.
The machine in question is now in use. Thus i have no way to test if this solved the problem.