Hello, I'm new to the forum, and saw a post from some time ago answered by chown33, and thought I'd see if I could get some direction from you in a new post rather than reply to an old one. Do you have an example of this type of plist I could use as a base, and is it able to run a app compiled applescript before login, or is it constrained to only be able to run certain types of scripts/programs? THANKS for any help/example plist you can offer!
Originally Posted by CodeBreaker View Post
Correct me if I am wrong. I believe Launch Agents are run on behalf of a user and hence need a user to be logged in to the OS, whereas Launch Daemons can be run even if no one is logged into the OS.
That's basically right, but see the man pages for launchd.plist and launchctl. Look at the plist key LimitLoadToSessionTypes, then at the -S option to launchctl which lists the session types. The LoginWindow session type will run a launch agent at the login window. For example, I have a wacom graphics tablet whose LaunchAgents plist file contains Aqua and LoginWindow session types. This means it runs even when no one is logged in. The file is owned by root, and is unwritable to others.
I have not experimented with the other session types.
Originally Posted by CodeBreaker View Post
Correct me if I am wrong. I believe Launch Agents are run on behalf of a user and hence need a user to be logged in to the OS, whereas Launch Daemons can be run even if no one is logged into the OS.
That's basically right, but see the man pages for launchd.plist and launchctl. Look at the plist key LimitLoadToSessionTypes, then at the -S option to launchctl which lists the session types. The LoginWindow session type will run a launch agent at the login window. For example, I have a wacom graphics tablet whose LaunchAgents plist file contains Aqua and LoginWindow session types. This means it runs even when no one is logged in. The file is owned by root, and is unwritable to others.
I have not experimented with the other session types.