Hypothetical "port load", "port unload" commands (and "turn" script)

Randall Wood rhwood at mac.com
Wed Nov 21 01:34:00 PST 2007


On 20 Nov 2007, at 12:07, James Berry wrote:

> Hi Ryan,
>
> On Nov 20, 2007, at 9:01 AM, Ryan Schmidt wrote:
>
>> I've written many replies on this list explaining to people how to  
>> use launchctl to start and stop various services installed by  
>> MacPorts. Every time I do, I have to refer back to my notes to  
>> remember the exact launchctl command and the exact path to the  
>> plist. Admit it:
>>
>> sudo launchctl load -w /Library/LaunchDaemons/org.macports.foo.plist
>>
>> is not easy to remember, and it's a lot to type.
>>
>>
>> On my system, I wrote a script "turn" to simplify things for me. I  
>> can say things like:
>>
>> turn foo on
>>
>> or
>>
>> turn off bar
>>
>> and it knows where to look for the plist and how to execute the  
>> appropriate launchctl command. It's short and easy to remember. It  
>> also prints helpful messages if you try to turn something on when  
>> it's already on, or off when it's already off.
>>
>>
>> It would be nice to have easier-to-remember commands included with  
>> MacPorts, but a script called "turn" hardly seems to fit in with  
>> the rest of the project. But what about:
>>
>> sudo port load foo
>>
>> and
>>
>> sudo port unload bar
>>
>> ? That's pretty easy to remember in my opinion. What do you think?
>
> I like this. We could look for a startupitem in the port, get the  
> name, and put the proper command together for launchctl. Very nice.  
> Do we have any other conceivable uses for the words load and unload  
> that this might conflict with?
>
> James
>
>
>>
>>
>>
>> This proposed syntax limits us to one launchctl plist per port.  
>> However, we already have that limit, so I don't consider it a big  
>> problem at this time.

We already have ports that install multiple lauchctl plists per port,  
although they use upstream provided plists to do so (avahi).

>> P.S: I'm including my "turn" script for others to examine and try  
>> out and even use, if they like. But I'm not suggesting that this  
>> script be incorporated as-is into MacPorts. I would fully intend  
>> for the hypothetical "port load" and "port unload" commands to be  
>> properly implemented in Tcl.
>>
>>
>> <turn>_______________________________________________
>> macports-dev mailing list
>> macports-dev at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo/macports-dev
>
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-dev



Randall Wood
rhwood at mac.com
http://shyramblings.blogspot.com

"The rules are simple: The ball is round. The game lasts 90 minutes.  
All the
rest is just philosophy."




More information about the macports-dev mailing list