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

Re: Postgresql doesn't start on reboot but does if you run sh /etc/rc.local



On Fri, 25 Mar 2005 23:52:37 +0000, David Jenkins
<david_(_dot_)_jenkins_(_at_)_gmail_(_dot_)_com> wrote:
> Dan Becker wrote:
> > On Fri, 25 Mar 2005 22:46:32 +0000, David Jenkins
> > <david_(_dot_)_jenkins_(_at_)_gmail_(_dot_)_com> wrote:
> >
> >>Hi,
> >>
> >>I'm sorry for having to ask this question but I'm not sure what I'm
> >>doing wrong.
> >>
> >>I'm running OpenBSD 3.6 patch branch and have just installed the
> >>postgresql-server-7.4.3p1 package. I've followed the instructions from
> >>/usr/local/share/doc/postgresql/README.OpenBSD.
> >>
> >>I have copied
> >>
> >>if [ -x /usr/local/bin/pg_ctl ]; then
> >>         su -l _postgresql -c "/usr/local/bin/pg_ctl start \
> >>                 -D /var/postgresql/data -l /var/postgresql/logfile \
> >>                 -o '-D /var/postgresql/data'"
> >>         echo -n ' postgresql'
> >>fi
> >>
> >>into /etc/rc.local and have copied
> >>
> >>if [ -f /var/postgresql/data/postmaster.pid ]; then
> >>         su -l _postgresql -c "/usr/local/bin/pg_ctl stop -m fast \
> >>                 -D /var/postgresql/data"
> >>         rm -f /var/postgresql/data/postmaster.pid
> >>fi
> >>
> >>into /etc/rc.shutdown. I have created a new login class in
> >>/etc/login.conf (and rebuilt the db and altered the class with vipw)
> >>
> >>postgresql:\
> >>                 :openfiles-cur=768:\
> >>                 :tc=daemon:
> >>
> >>and have even tried adding the following to /etc/sysctl.conf
> >>
> >>kern.seminfo.semmni=256
> >>kern.seminfo.semmns=2048
> >>
> >>If I boot/reboot my machine then postgresql does not start and nothing
> >>is mentioned in the logfile. At the console, it gives the impression
> >>that postgresql has started and says
> >>
> >>postmaster succesfully started
> >>  postgresql
> >>
> >>Yet, once booted if I run as root `sh -x /etc/rc.local' postgresql starts!?
> >>
> >>I've tried rm -rf /var/postgresql/data/* and rebuilding it with `initdb
> >>-D /var/postgresql/data'
> >>
> >>What am I doing wrong? Thanks for for any pointers.
> >>
> >>David
> >>
> >>
> >
> > I had this problem and once I added
> >
> >
> > if [ -x /usr/local/bin/pg_ctl ]; then
> >         su -l _postgresql -c "/usr/local/bin/pg_ctl start \
> >                 -D /var/postgresql/data -l /var/postgresql/logfile \
> >                 -o '-D /var/postgresql/data'"
> >         echo -n ' postgresql'
> > fi
> >
> > to /etc/rc.securelevel I no longer had that problem
> 
> Thanks Dan, that did the job.
> 
> I'm running in securelevel 1. Do you know what's present in that level
> that is causing this problem? I've checked the man page I can't see
> anything obvious.
> 
> David
> 

nope 

i started to look and got in over my head

it works the way i did it ... so im not worried about it