0

I was installing postgres and may have installed it twice. The first installation appears to be spinning up a postgres server with a password I admittedly don't remember.

I used netstat -vanp tcp | grep 5432 to determine the PID then I used ps aux | grep 560 to find the program (as seen below)

postgres           560   0.0  0.0 408830848   2208   ??  Ss   18Apr22   0:10.26 /Library/PostgreSQL/14/bin/postmaster -D /Library/PostgreSQL/14/data

How can I go about preventing this program from starting up automatically?

EDIT: I'm on a M1 mac with Monterey 12.3.1

EDIT2: I've run sudo launchctl list | grep post and was able to find the postgres program under

560 0   postgresql-14

now I'm looking into how to remove it from launchctl

irregular
  • 1,437
  • 3
  • 20
  • 39
  • Does this answer your question? [How to remove autostart of apache on macosx](https://stackoverflow.com/questions/8065288/how-to-remove-autostart-of-apache-on-macosx) – Tobias S. May 03 '22 at 21:04
  • It's insightful but maybe because I'm on an m1 mac and Monterey 12.3.1, the interface has changed since then so the instructions don't work (w.r.t System Preferences -> Users doesn't exist and Users & Groups which exists doesn't have postgres under Login Items) I'm trying out the launchlist commands atm though – irregular May 03 '22 at 21:14

1 Answers1

0

You can enable or disable services that run on start up by running systemctl command

sudo systemctl disable postgres 
imadhou
  • 1
  • 1
  • I get `sudo: systemctl: command not found` – irregular May 03 '22 at 21:13
  • Are you using mac or Linux? this command is for Linux for mac see https://stackoverflow.com/questions/47934081/does-the-command-systemctl-and-service-exists-on-linux-only-and-not-mac it's the equivalent for it in mac – imadhou May 03 '22 at 21:22
  • I'm on mac. `launchctl` works. I'm looking around for the command to remove postgres though, I'll update the question with the output of `sudo launchctl list` – irregular May 03 '22 at 21:24