Helo all, my problem is more Gentoo oriented...this is my opinion of course, but I hope someone is using Postgres over Gentoo and helps me to solve problem.I posted same thread in gentoo forums but I still got no answer that helps me to fix this issue I dont have any ideas what causing it .
Code:
ze64 ~ # ps auxf | grep postgres
root 9715 0.0 0.0 8508 744 pts/23 S+ 20:34 0:00 | \_ grep --colour=auto postgres
postgres 9708 5.0 0.0 38812 2460 ? Ss 20:34 0:00 /usr/bin/postmaster -D /var/lib/postgresql/data --silent-mode=true -N 40 -B 80
postgres 9710 0.0 0.0 38812 1092 ? Ss 20:34 0:00 \_ postgres: writer process
postgres 9711 0.0 0.0 35228 972 ? Ss 20:34 0:00 \_ postgres: stats collector process
ze64 ~ # ls /var/lib/postgresql/data/ | grep pid
postmaster.pid
ze64 ~ # /etc/init.d/postgresql stop
* Stopping PostgreSQL ... [ !! ]
* ERROR: postgresql failed to stop
ze64 ~ # ps auxf | grep postgres
root 9729 0.0 0.0 8508 740 pts/23 S+ 20:34 0:00 | \_ grep --colour=auto postgres
ze64 ~ # ls /var/lib/postgresql/data/ | grep pid
ze64 ~ # /etc/init.d/postgresql start
* WARNING: postgresql has already been started
ze64 ~ # ps auxf | grep postgres
root 9743 0.0 0.0 8508 744 pts/23 S+ 20:34 0:00 | \_ grep --colour=auto postgres
ze64 ~ # ls /var/lib/postgresql/data/ | grep pid
ze64 ~ # /etc/init.d/postgresql zap
* Manually resetting postgresql to stopped state
ze64 ~ # /etc/init.d/postgresql start
* Starting PostgreSQL ... [ ok ]
ze64 ~ # ps auxf | grep postgres
root 9765 0.0 0.0 8508 744 pts/23 S+ 20:35 0:00 | \_ grep --colour=auto postgres
postgres 9758 5.3 0.0 38812 2460 ? Ss 20:35 0:00 /usr/bin/postmaster -D /var/lib/postgresql/data --silent-mode=true -N 40 -B 80
postgres 9760 0.0 0.0 38812 1092 ? Ss 20:35 0:00 \_ postgres: writer process
postgres 9761 0.0 0.0 35228 972 ? Ss 20:35 0:00 \_ postgres: stats collector process
ze64 ~ # ls /var/lib/postgresql/data/ | grep pid
postmaster.pid
ze64 ~ #
In /var/log/messages is written same as this on stderr. I also enable logging for postgres (nothing useful for problem), but as I said I think problem is related with init script.
I wondering how init script says "postgresql has already been started" ,when there is no pid file, looks like init holds somewhere info about state of started or stopped daemons . I found in /lib64/rc some things related to init, when I start postgres init creates in /lib64/rc/init.d/daemons/ dir named postgresql, but when I stopped it this dir is still there, wheh i use init script with zap option dir disappear and after new start init creates it again, so I wonder why this happens. Just for experiment I stopped sshd and sshd dir in lib64/rc/init.d/daemons/ disappear when started it again dir was created without using zap option.
Please help.
Excuse me mods if thread is not at the right place.
Thanks in advance.
SOLVED :
I find solution here :
http://bugs.gentoo.org/show_bug.cgi?id=231660
I just removed --oknodo in script as described in comments and now postgres starting and stopping normally .