[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

apt-get upgrade... and now postgres 7.4 won't start!



on debian 4.0, apt-get update && apt-get upgrade led to a problem
where postgres 7 won't start! apparently utility program
"pg_controldata" is supposed to generate some locale-info that's
parsed by perl script "pg_ctlcluster", and the two suddenly don't jibe
at all--

argh:

"""
Setting up postgresql-7.4 (7.4.23-0etch1) ...
Starting PostgreSQL 7.4 database server: mainpg_controldata: could not
open file "/var/lib/postgresql/7.4/main/global/pg_control" for
reading: No such file or directory
Error: Could not parse locale out of pg_controldata output
 failed!
invoke-rc.d: initscript postgresql-7.4, action "start" failed.
dpkg: error processing postgresql-7.4 (--configure):
 subprocess post-installation script returned error exit status 1
"""

trying /etc/init.d/postgresql-7.4 start -- we traced the process where
the trouble occurs to perl script "pg_ctlcluster":

# perl -Td `which pg_ctlcluster ` 7.4 main start

after some stepping and nexting, we get to here:

pg_controldata: could not open file
"/var/lib/postgresql/7.4/main/global/pg_control" for reading: No such
file or directory
PgCommon::get_cluster_locales(/usr/share/postgresql-common/PgCommon.pm:707):
707:        restore_exec;

                                                   DB<2> v
704:        prepare_exec ('LC_ALL', 'LANG', 'LANGUAGE');
705:        $ENV{'LC_ALL'} = 'C';
[B]706:        my $result = open (CTRL, '-|', $pg_controldata,
(cluster_data_directory $version, $cluster));
[/B]707==>      restore_exec;
708:        return (undef, undef) unless defined $result;
709:        while (<CTRL>) {
710:            if (/^LC_CTYPE\W*(\S+)\s*$/) {
711:                $lc_ctype = $1;
712             } elsif (/^LC_COLLATE\W*(\S+)\s*$/) {
713:                $lc_collate = $1;

the problem is in line 706 -- open(filehandle, mode, file) -- the mode
is "-|" meaning that "file" is really a command that generates output
that's piping to our perl process... but $pg_controldata isn't playing
nice:

/usr/lib/postgresql/7.4/bin/pg_controldata /var/lib/postgresql/7.4/main
pg_controldata: could not open file
"/var/lib/postgresql/7.4/main/global/pg_control" for reading: No such
file or directory

therein lies the rub. suggestions are welcome!

===

also, if i 'cheat' and manually inject $lc_type = 'C' around line 709,
then the result is only slightly different:

"""
The PostgreSQL server failed to start. Please check the log output:
/usr/lib/postgresql/7.4/bin/postmaster: could not find the database system
Expected to find it in the directory "/var/lib/postgresql/7.4/main",
but could not open file
"/var/lib/postgresql/7.4/main/global/pg_control": No such file or
directory
"""

there *is* a pg_control.gz file there, which contains "[<digit>] <digits>"...?

ideas?

--
will trillich -- http://faq.serensoft.com/
Less is only more where more is no good. -- Frank Lloyd Wright


Reply to: