Port Upgrade vs Loaded Startupitems

Ryan Schmidt ryandesign at macports.org
Sun Oct 25 20:34:40 PDT 2009


On Oct 25, 2009, at 19:49, Joshua Root wrote:

> On 2009-10-26 09:37, Ryan Stonecipher-Fisher wrote:
>> A port I co-maintain (mpd) includes a startupitem section which I  
>> keep
>> loaded using 'launchctl load -w'.
>> Upon updating the port, the old binary is still running in launchd
>> limbo; 'launchctl unload -w' doesn't work properly, so in turn
>> 'launchctl load -w' doesn't work properly either.
>> Are startupitems unloaded during port deactivation?
>> If not, could that step be added to deactivation for ports which do
>> contain startupitems?
>
> Sure. As has been mentioned before, the startupitem code needs some  
> love.

Would be a good idea. That was half of my motivation for introducing  
"port load" and "port unload" -- so that we could hook into them at  
activate and deactivate time. But we never did that.


> For bonus points, record both the state of the plist (enabled/ 
> disabled)
> and whether the daemon is actually running (since these aren't
> necessarily the same), and restore both to their former state after  
> the
> upgrade completes.

Currently, we always install a plist that says the service is stopped.  
If you had the service running when you upgraded the port, this is now  
wrong.

So we could either keep track of the state, and write the correct  
state into the new plist when we install it, or we could just ensure  
the service is always stopped when a port is deactivated -- either by  
automatically calling port unload, or by telling the user to do so.






More information about the macports-dev mailing list