krypted.com

Tiny Deathstars of Foulness

In Mac OS X you can use cron to schedule tasks but you can also use launchd.  To use launchd to load or unload an agent where you’ve setup a task use the launchctl command.  Here we will use launchctl to manually start a process given that we defined a plist called /Library/LaunchAgents/com.apple.OpenProgram.plist (where program is maybe the name of some program you want to fire up):

launchctl load Library/LaunchAgents/com.apple.OpenProgram.plist

Your application should fire up now.  Do not quit it for ten seconds. Wait about 15, then quit it. Notice it start up again. This is because it is a launchAgent and will restart any time it is closed.  Now run:

launchctl unload Library/LaunchAgents/com.apple.OpenProgram.plist

Watch your program close.

May 29th, 2007

Posted In: Mac OS X, Mac OS X Server, Mac Security

Tags: , , ,

  • http://macconsultinggroup.com Allen Hancock

    Ok, here’s a fun follow up… once the job is loaded with a StartInterval, how can we ask Launchd to let us know when it plans on running the job next?

    I.E., how many seconds ago did that job with a StartInterval of 600 last run?

    I’ve asked this here as well:

    http://apple.stackexchange.com/questions/35968/get-current-startinterval-status-from-launchd

  • http://discus.com/albertguenther Albert Guenther

    It seems that the icon storage image agent or the launch image agent, have been integrated into the new operating system- 10.11.4. Rather it be “iTunes Quit” Or Garage Band quit unexpectedly – it will continue to compromise our iMacs unless we start to put pressure on those working under a loaded gun- Tim Cooks, and his Board of directors. Ya see there has to be a pragmatic reason for all these unnecessary problems that continue to “DRIVE US NUTS”. I think it is timer for Tim Cooks to Resign – unless you want to continue to doing the same thing over and over again expecting different results. There is reason that they are not telling us why so many terminal commands and user friendly tasks are not user friendly anymore. I would keep an eye on where Apple is manufacturing, and why they seem to be using more software from Microsoft. Garage band is not the way it use to be, and the sudo command is no longer available. iTunes quits unexpectedly and iPhoto does not work the way it use to. Could it be that Tim Cooks has an alternative plan – like a merger, or a dirty little secret i would like to call vulture capitalism. Parts – hardware is being made cheaper, and now the 4k and 5k iMacs are being distributed – which would mean that updates of the operating system will eventually make your iMac obsolete. So if your one of those who have an old version that is not a 4k or 5k you might not have access to OSX Operating system. Your apps all no longer be compatible with your non 4k 5k OSX operating system. Third party developers like google, adobe flash player, and java, will not download properly. So think about all those third party developers who continue to play cat and mouse- with Apple. I think we need to keep an eye on their shares, and plug into the Consumer Affairs website, and use Facebook and other Social media out lets. We cannot continue fix these unnecessary updates that are plagued with more glitches.

  • http://discus.com/albertguenther Albert Guenther

    THE INEVITABLE “IT QUIT UNEXPECTEDLY” OR ANOTHER “CRASH REPORT”.