Many Postgresql process. how to handle them?

I'm trying to fix an already install openNMS system on ubuntu. Currently I'm facing issue with postgresql. I stop server using this commnad:

service postgresql -$PGVERSION stop

after that when i run command:

ps ax | grep postgres

i get following output:

8198 pts/1    S+     0:00 grep --color=auto postgres
29104 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55176) idle                                                                             
29193 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55220) idle                                                                             
29195 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55221) idle                                                                             
29196 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55222) idle                                                                             
29198 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55223) idle                                                                             
30367 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55345) idle                                                                             
30373 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55350) idle                                                                             
30381 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55358) idle                                                                             
30396 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55370) idle                                                                             
30406 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55380) idle                                                                             
30415 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55387) idle                                                                             
30423 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55395) idle                                                                             
30430 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55401) idle                                                                             
30441 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55410) idle                                                                             
30445 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55414) idle                                                                             
30447 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55415) idle                                                                             
30449 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55416) idle                                                                             
30451 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55417) idle                                                                             
30453 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55418) idle                                                                             
30455 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55419) idle                                                                             
30457 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55420) idle                                                                             
30460 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55421) idle                                                                             
30463 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55422) idle                                                                             
30466 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55423) idle                                                                             
30468 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55424) idle                                                                             
30471 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55425) idle                                                                             
30474 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55426) idle                                                                             
30480 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55427) idle                                                                             
30485 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55428) idle                                                                             
30490 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55429) idle                                                                             
30492 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55430) idle                                                                             
30501 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55446) idle                                                                             
30504 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55453) idle                                                                             
30507 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55459) idle                                                                             
30509 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55461) idle                                                                             
30512 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55464) idle                                                                             
30514 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55466) idle                                                                             
30516 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55470) idle                                                                             
30518 ?        Ss     0:00 postgres: opennms opennms 127.0.0.1(55472) idle 

Now I dont know how to end all these process. also when i run top command... i can see long list of postgresql processes. this is a production server so i can't reboot it. Please let me know how can i get rid of it.


The postgres processes you see are tied to OpenNMS. You would need to stop the OpenNMS service first before stopping the postgres database.

/etc/init.d/opennms stop or service opennms stop will stop OpenNMS.

The multiple postgres processes will disappear after that.