Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#8963 closed defect (invalid)

postgresql8 +server -- launchctl / daemondo cannot stop postgres

Reported by: armando@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.2
Keywords: Cc:
Port:

Description

Mac Intel - 10.4.6

I followed the output directions that the port install of postgresql +server directed me to do, as well as the output of those commands themselves, except for the one that actually starts postgresql -- I knew launchctl was supposed to take care of this.

Anways, doing a: sudo launchctl stop org.darwinports.postgresql8 does not stop the server, it restarts it. I have the feeling I maybe missing something, but I am therefore unsure.

Not the server is indeed being restarted, but not stopped (note the process ids):


chani:~ armando$ sudo launchctl stop org.darwinports.postgresql8 chani:~ armando$ ps ax |grep post

500 ?? Ss 0:00.01 --label=postgresql8 --start-cmd /opt/local/etc/LaunchDaemons/org.darwinports.postgre 507 ?? S 0:00.15 /opt/local/lib/pgsql8/bin/postmaster -D /opt/local/var/db/pgsql8/defaultdb 509 ?? S 0:00.00 postgres: writer process 510 ?? S 0:00.00 postgres: stats buffer process 511 ?? S 0:00.00 postgres: stats collector process 513 p1 R+ 0:00.00 grep post

chani:~ armando$ sudo launchctl stop org.darwinports.postgresql8 chani:~ armando$ ps ax |grep post

518 ?? Ss 0:00.01 --label=postgresql8 --start-cmd /opt/local/etc/LaunchDaemons/org.darwinports.postgre 525 ?? S 0:00.13 /opt/local/lib/pgsql8/bin/postmaster -D /opt/local/var/db/pgsql8/defaultdb 527 ?? S 0:00.00 postgres: writer process 528 ?? S 0:00.00 postgres: stats buffer process 529 ?? S 0:00.00 postgres: stats collector process 531 p1 R+ 0:00.00 grep post


...and...


LOG: database system is ready LOG: transaction ID wrap limit is 2147484146, limited by database "postgres" LOG: received fast shutdown request LOG: shutting down LOG: database system is shut down LOG: database system was shut down at 2006-05-17 17:34:20 EDT LOG: checkpoint record is at 0/33E54C LOG: redo record is at 0/33E54C; undo record is at 0/0; shutdown TRUE LOG: next transaction ID: 565; next OID: 10794 LOG: next MultiXactId: 1; next MultiXactOffset: 0 LOG: database system is ready


Any info, or fixes, would be greatly appreciated. I simply want a clean way to stop the postgresql server at times, and I think the LaunchDaemons plist is trying to give me this ability, and failing.

Change History (2)

comment:1 Changed 18 years ago by jberry@…

Resolution: invalid
Status: newclosed

Since the server is set to run continuously, stop doesn't really stop it, as you've seen. You need to "unload" it to stop it, and "load" it to start it again.

sudo launchctl unload -w org.darwinports.postgresql8 sudo launchctl load -w org.darwinports.postgresql8

The -w flag writes the new load state to the .plist. Otherwise, it'll resume its load state when you restart the machine.

James

comment:2 Changed 18 years ago by armando@…

*ahhh*

Thanks for the clarification.

Note: See TracTickets for help on using tickets.