0

I put my plist in /Library/LaunchAgents and my exexutive program in /usr/libexec and daemon statrs when system startup . But this daemon is owned by user . I try to put my plist in /Library/LauchDaemons but it's not working and daemon doesn't starts in system startup

I want to know how to make a daemon launch as root when system starts up.What additional jobs should I do to make a daemon launch as root ? Thanks in advance!

2 Answers2

4

After you put plist in /Library/LaunchDaemons you need to run command sudo launchctl load -w /Library/LaunchDaemons/your.plist
See man launchctl for the -w flag (it does exactly what you need)
Edit: did you set the RunAtLoad key to true in your plist?
Edit2: I forgot, RunAtLoad has no influence on autolaunch, it is all bout Disabled key.

cody
  • 156
  • 3
0

Change the directory where you put your plist, like this:

/System/Library/LaunchDeamon

This directory was read from Launchd before the startup of user.

ChrisF
  • 41,540