[MacTUG] UW Emerge on the Macs

Guillermo Fuentes gfuentes at uwaterloo.ca
Mon Dec 12 11:15:12 EST 2011


Hello all,
A couple of weeks ago we got a notification from IST about some of our Macs connecting to emerge.uwaterloo.ca at a high rate. It turned out to be the Emerge client running multiple times as a result of not being killed after the user's logoff. I was using the "Login Items" way of running it.As a temporary workaround, I added a command to the LogoutHook to kill all the emerge processes when the user logoff.
I found a simple and more convenient way (at least for me) of running the Emerge client. It's running it as a Launchd Agent. This way it runs on the user's context whenever a user logs on, and it stops when the user logs off. Very easy to package and I've tested it on Snow Leopard and Lion.
This only requires:
- the emergecli program on /Applications/emergecli
- and the launchd.plist file on /Library/LaunchAgents/ca.uwaterloo.EmergeD.plist (content of this file at the end of the email.)

As I was told this was a campus wide issue, I just wanted to share what I found.

Cheers,
Guillermo

*****
Content of /Library/LaunchAgents/ca.uwaterloo.EmergeD.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>EmergeD</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Applications/emergecli</string>
        </array>
</dict>
</plist>

________________________________________
From: mactug-bounces at lists.uwaterloo.ca [mactug-bounces at lists.uwaterloo.ca] on behalf of Steve Hellyer [phasetwo at apple.com]
Sent: Tuesday, February 01, 2011 9:27 AM
To: MacTUG at lists.uwaterloo.ca
Subject: Re: [MacTUG] UW Emerge on the Macs

Yes you can manage login items with Workgroup manager but on a computer or computer group basis. Doesn't work with Users or groups. Think you want computer anyway from what I have seen so far on this thread, but maybe mistaken as not sure what Emerge is.

If it's a command line application you can incorporate into either login hook (See Scripts image below) or create a simple Applescript to launch the shell command which get include with items. This need to be present on the base image so it can be run at login.

Example screenshot…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20111212/ee796111/attachment.html>


More information about the MacTUG mailing list