3

Just for the heck of it I was running pgrep postgres and got a ton of results:

postgres  1882     1  0 10:06 ?        00:00:00 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
postgres  1883     1  0 10:06 ?        00:00:00 /usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf
postgres  1943  1883  0 10:07 ?        00:00:00 postgres: checkpointer process                                                                                              
postgres  1944  1883  0 10:07 ?        00:00:00 postgres: writer process                                                                                                    
postgres  1945  1883  0 10:07 ?        00:00:00 postgres: wal writer process                                                                                                
postgres  1946  1883  0 10:07 ?        00:00:00 postgres: autovacuum launcher process                                                                                       
postgres  1947  1883  0 10:07 ?        00:00:00 postgres: stats collector process                                                                                           
postgres  1948  1882  0 10:07 ?        00:00:00 postgres: checkpointer process                                                                                              
postgres  1949  1882  0 10:07 ?        00:00:00 postgres: writer process                                                                                                    
postgres  1950  1882  0 10:07 ?        00:00:00 postgres: wal writer process                                                                                                
postgres  1951  1882  0 10:07 ?        00:00:00 postgres: autovacuum launcher process                                                                                       
postgres  1952  1882  0 10:07 ?        00:00:00 postgres: stats collector process                                                                                           

First off I think it's a little weird that postgres9.3 and 9.4 seem to be running at the same time, but that's a bit of a separate issue.

I don't need postgres to run on startup, though I can start it with sudo service postgres start as needed. I'd like to start 9.4, though.

I've looked into updating startup processes, but it doesn't seem like there is a hard-and-fast way to do this and answers typically surround creating your own startup scripts.

It seems like my best bet would be to remove or unlink /etc/init.d/postgres somehow, but I'm not quite sure of the best way to go about doing this. I have /etc/rc{2,3,4,5}.d/SO3postgresql as well and they all seem to link to the init.d script. What would be the best way to prevent a script from starting on boot -- particularly postgres?

  • Can you find an Application Autostart setting, on ubuntu Settings? I'm on xubuntu and looks like this: imgur.com/UdHrtRw – xdola Oct 14 '15 at 21:15
3

Use update-rc.d to turn on and off services during startup.

update-rc.d postgres remove

update-rc.d takes care of all the links in your /etc/rcX.d directories.

Note: this doesn't remove the startup script from /etc/init.d, just all the links in the /etc/rcX.d directories!

See update-rc.d man page for more information.

EDIT I didn't realize you were using ubuntu, so I looked up the equivalent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.