-
All replies
-
Helpful answers
-
Feb 18, 2015 9:41 AM in response to DaniAtWaterlooby twtwtw,Where is your LaunchAgent plist file stored? If you place it in ~/Library/LaunchAgents it will run at login as the given user with the user's privileges, but if you place it in /Library/LaunchAgents it ought to run at login as the given user with administrator privileges.
-
Feb 18, 2015 12:07 PM in response to twtwtwby DaniAtWaterloo,Added a "mkdir /NEWDIR" to my script called from my /Library/LaunchAgents/blah,plist and it gives permission denied so that doesn't seem to be true.
-
by Linc Davis,Feb 18, 2015 1:28 PM in response to DaniAtWaterloo
Linc Davis
Feb 18, 2015 1:28 PM
in response to DaniAtWaterloo
Level 10 (207,990 points)
ApplicationsAgents always run with the user's privileges at login. Your best option is to correct the underlying problem, not to try to paper over it with launchd.
-
Feb 19, 2015 7:52 AM in response to Linc Davisby DaniAtWaterloo,That's why I was talking about a daemon.
I tried using WatchPaths on /dev/console but it doesn't get triggered enough
so I'll do WatchPaths on /var/run/utmpx even though it gets triggered by a couple of extra events.
-
by Linc Davis,Feb 19, 2015 10:10 AM in response to DaniAtWaterloo
Linc Davis
Feb 19, 2015 10:10 AM
in response to DaniAtWaterloo
Level 10 (207,990 points)
Applications -
Feb 19, 2015 11:43 AM in response to Linc Davisby DaniAtWaterloo,- Login and logout scripts are a deprecated technology. In most cases, you should use
launchdjobs instead, as described inCreating Launch Daemons and Agents.
- Login and logout scripts are a deprecated technology. In most cases, you should use
-
by Linc Davis,Feb 19, 2015 11:52 AM in response to DaniAtWaterloo
Linc Davis
Feb 19, 2015 11:52 AM
in response to DaniAtWaterloo
Level 10 (207,990 points)
ApplicationsYes, I know it's deprecated, but it still works and does what you say you want: running a root task when a user logs in. Good luck.