Jump to content

LaunchAgents - autostart Applications even in Safe Mode


naquaada
 Share

1 post in this topic

Recommended Posts

Don't you know the problem when you have a program which you want to run every time at login, and it isn't available wen booting in Safe Mode? A good example is the VoodooHDASettingsLoader, if you don't load it you'll always have this annoying noise.

 

For this you can use LaunchAgents. You can find them in these paths:

 

/Library/LaunchAgents

/System/Library/LaunchAgents

 

The ones in /System/Library will start even in Safe Mode. Possibly there's also a LaunchAgents folder in your home folder/Library.

 

LaunchAgents are just common .plist files, nothing special. they have no binaries itself, easy said they are program starters with various options. You can run multiple shell commands with options and whatever. MacOS X Applications can be used by executing the binary in the MacOS folder of the application package. There are still a lot more options in LaunchAgent plists, search the net for it.

 

This is an example for the VoodooHDSettingsLoader. The program must be located in /Applications.

<?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>
    <false/>
    <key>Label</key>
    <string>com.MyLA.VoodooHDA.plist</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Applications/VoodooHdaSettingsLoader.app/Contents/MacOS/VoodooHdaSettingsLoader</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

- The name of the file will be 'com.MyLA.VoodooHDA.plist'. I'm using always 'com.MyLA' (MyLaunchAgents) at the beginning, so it's easier to find own LaunchAgents, and probably there won't be name conflicts with other LA's from other programs.

- KeepAlive entry: false - The LA is executed oly once

- Label entry - It's the name of the LA, don't know if it must be the same as the filename.

- ProgramAgrumentsEntry - Here you can run your commands. There's only one program executed, the binary of /Applications/VoodooHdaSettingsLoader.

- RunAtLoad entry: true - The Launcher is started during booting.

 

If you use this as file 'com.MyLA.VoodooHDA.plist' in /Library/LaunchAgents it will executed at boot, but only in standard booting.

If you put it in /System/Library/LaunchAgents, it will even executed in Safe Mode.

 

The method with the LaunchAgents is great, not only because you can run Apps in Safe mode, you have much more options to control them. It's also useful to reduce your autostart list in the Users autostart list, or if you want to execute operations invisible. But not everything is working, f.e. mouting Disk Images or Network Volumes.

It's always best to set the permissions to root/wheel. It's not neccessary, but better.

Link to comment
Share on other sites

 Share

×
×
  • Create New...