[MacTUG] emerge a bit better

Dani Roloson daroloso at mfcf.math.uwaterloo.ca
Thu Jul 5 13:53:36 EDT 2012


Guillermo in December posted:

> 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.
...
> 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.
...
> 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>

Now I don't have my clients talking to a server so couldn't remove the
emergestart from everyone's login items so instead I opened up
emergestart in Automator and changed

/Applications/emergecli >&/dev/null &

to

osascript -e 'tell application "System Events" to delete login item "emergestart"' >&/dev/null &

(so if in their login items, it runs and removes itself from login items. 8-)

and then packaged the three pieces with Composer so I can throw it my clients
through ARD. I did have one user with 8 emergecli's running and I've tested
it on 10.5.  The only thing it won't do is kill off those 8 so I told the user
to reboot at end of today.

Dani 
MFCF


More information about the MacTUG mailing list