macports stages - how to stop server processes?

Ryan Schmidt ryandesign at macports.org
Mon Oct 20 15:15:09 PDT 2008


On Oct 20, 2008, at 16:24, Darren Weber wrote:

> RE: http://guide.macports.org/#reference.phases
>
> Can we define phases for deactivate and uninstall?
>
> For example, postgresql83-server is left running after doing  
> uninstall.  There should be an option to take down and remove any  
> config data for a server process during the deactivate and  
> uninstall phases.  In the case of postgresql83-server, it is  
> monitored by daemondo (which is watched by launchd), so we need to  
> do a couple of things (not sure of the right order):
>
> a) sudo launchctl unload -w /Library/LaunchDaemons/ 
> org.macports.postgresql83-server.plist
> b) stop daemondo watching the server
> c) stop the server
> d) remove launch files
> e) remove config files (or maybe this is part of 'clean --all').
>
> Any suggestions?
>
> Thanks, Darren
>
> PS, Come to think of it, it might be useful to be able to do these  
> things when upgrading a server installation (ie: first stop and  
> remove the current server).

There is a longstanding issue...

If you have a server running and you upgrade the port, then the old  
plist (that says the server was running) gets removed (because it's  
part of the files installed by the port) and the new plist that gets  
installed says the server isn't running, though it still is.

We added "port load" and "port unload" to 1.7. What I think we should  
still do is call "port unload" automatically before we call "port  
deactivate" (if the port was loaded), and then after "port activate",  
we should automatically call "port load" (if the port was previously  
loaded).



More information about the macports-users mailing list