User postgres can't write to /var/lib/postgresql

Bug #32696 reported by freshi
4
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

The user postgres has no write privileges to it's own HOME directory /var/lib/postgresql.

ls -la /var/lib/postgresql/
total 12
drwxr-xr-x 3 root root 4096 Feb 24 10:45 .
drwxr-xr-x 42 root root 4096 Feb 24 10:45 ..
drwxr-xr-x 3 postgres postgres 4096 Feb 24 10:45 8.1

postgres@ubuntu:~$ touch ~/foo
touch: cannot touch `/var/lib/postgresql/foo': Permission denied

This problem occurs when you leaving psql, i.e.:

postgres@ubuntu:~$ psql template1
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=# \q
could not save history to file "/var/lib/postgresql/.psql_history": Permission denied
postgres@ubuntu:~$

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, user postgres is not really meant to be an interactive user, but I'll fix that.

Changed in postgresql-8.1:
assignee: nobody → pitti
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

 postgresql-common (43.1ubuntu2) dapper; urgency=low
 .
   * Merge changes from Debian branch (mainly robustness and test suite fixes).
   * t/020_create_sql_remove.t: Add check that SSL is automatically enabled on
     >= 8.0 clusters.
   * pg_createcluster: Improve SSL key access check to be more robust.
   * Enable taint checking in all programs and fix the resulting bugs.
   * PgCommon.pm: Replace backticks program calling with proper |- pipe opening
     to avoid intermediate shell and argument quoting problems.
   * testsuite: Only execute tests ending with .t.
   * Add t/100_upgrade_scripts.t: Test upgrade scripts.
   * run-upgrade-scripts:
     - Filter out the 'postgres' database on 8.1+ clusters.
     - Temporarily enable connections to databases which disable them.
     - Execute scripts in asciibetical order.
   * debian/postgresql-common.postinst: Ensure that /var/lib/postgresql is
     owned by postgres:postgres. (https://launchpad.net/bugs/32696)

Changed in postgresql-common:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.