Forum OpenACS Q&A: Re: PostgreSQL data disappeared

Collapse
Posted by Tom Jackson on

When they did the reboot, the postmaster.pid file was not removed. This means the postmaster process didn't startup as usual.

First check to verify that postmaster isn't running:

$ps axww|grep post

if you don't see a process for postmaster with your data directory, then you need to remove the postmaster.pid file and try starting it again.

What I don't get is that you were following Bruno's instructions on Oracle. Are you installing both databases?

The problem with the Oracle install is that the startup files in /etc/rc.d/init.d/oracle8i shut Oracle down after sshd goes down, and also the websites are usually still running. If the webserver is still running, Oracle will never shut down. The local keyboard will already not work, and you can no longer log in via ssh to cure the error. The only thing you can do is to power cycle the machine.

So, how do you control the webserver to ensure it goes down before Oracle? Also, what are the links in /etc/rc.d/rc6.d that contain oracle8i and sshd?

If you use daemontools (svc) to shut down the webservers, I have an init.d script that does that first on shutdown of the server. I'll post some better instructions later today.

I also found bugs in the init.d scripts of listener8i and postgresql: both fail to create a lock file like the Oracle8i script, which means that the processes are not correctly stopped when you shutdown or reboot.

Collapse
Posted by Jarkko Laine on
Tom,

The problem is that postmaster was running. I was able to connect to one of three databases there should have been, but it was empty.

And yes, I was installing Oracle for testing of dotLRN for my school, my own site uses PostgreSQL (or used, now it doesn't exist anymore).

I don't think I had any scripts for AOLserver in rc.d:

[root@swissnet rc6.d]# ls
K02postgresql  K25squid       K49oracle8i   K70bcm5820  K86nfslock
K03rhnsd       K25sshd        K50snmpd      K72autofs   K87portmap
K05anacron     K30sendmail    K50snmptrapd  K74apmd     K88syslog
K05atd         K34yppasswdd   K50tux        K74nscd     K90network
K05keytable    K35smb         K50xinetd     K74ntpd     K92ipchains
K10wine        K44rawdevices  K60crond      K74ypserv   K92iptables
K10xfs         K45winbind     K60lpd        K74ypxfrd   K95kudzu
K15gpm         K46radvd       K65identd     K75netfs    S00killall
K20nfs         K49listener8i  K70aep1000    K80random   S01reboot
But I do use svc to control web servers. It's just this was probably the first time I had to reboot the machine...