ubuntu icon
4th
Sep 10

Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster

Posted Saturday 4th September 2010
I received this error with PostgreSQL when using APT on Ubuntu Server 10.04. I still don’t know what triggered it (most likely permission related) but here’s an a quick cleanup.

Exact error output:

Preparing to replace postgresql-8.4 8.4.3-1 (using .../postgresql-8.4_8.4.3-1_amd64.deb) ...
 * Stopping PostgreSQL 8.4 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 63.
                                                                                                                                                                                                      [fail]
invoke-rc.d: initscript postgresql-8.4, action "stop" failed.
dpkg: warning: old pre-removal script returned error exit status 9
dpkg - trying script from the new package instead ...
 * Stopping PostgreSQL 8.4 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 63.
                                                                                                                                                                                                      [fail]
invoke-rc.d: initscript postgresql-8.4, action "stop" failed.
dpkg: error processing /var/cache/apt/archives/postgresql-8.4_8.4.3-1_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 9
 * Starting PostgreSQL 8.4 database server
 * Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 63.
                                                                                                                                                                                                      [fail]
invoke-rc.d: initscript postgresql-8.4, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 9
Errors were encountered while processing:
 /var/cache/apt/archives/postgresql-8.4_8.4.3-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

To clean this up remove the postmaster and reset the group and general permissions.

sudo rm /var/lib/postgresql/8.4/main/postmaster.pid
sudo chown postgres:postgres /etc/postgresql/8.4/main/environment
sudo chmod u+rw,g+rw /etc/postgresql/8.4/main/environment

Bookmark or share this page:

SociBook del.icio.us Digg Facebook Google Yahoo Buzz StumbleUpon

MSN Contact: contact [at] danielgibbs.net



6 Comments

  1. roodcah 2 May 2011 9:57 am

    thx.. my problem is solved

  2. pangestu 4 July 2011 6:03 pm

    tararenkyou…..

  3. suryakant maurya 31 October 2011 12:22 pm

    Thanks

  4. Nitesh Kumar 13 March 2012 7:53 am

    A lot of ta to you….

  5. Anil 25 April 2012 5:47 pm

    Thanks a lot…. was struggling to fix this from past 2 days….

  6. Othmen 7 September 2012 1:38 pm

    Thank you, you help me

TrackBack URL

Leave a comment