title: How to load system-wide daemons on MacOS
body: <p>I'm trying to load my daemon-app with this command <code>launchctl load /Library/LaunchDaemons/myPlistFileName</code> It works fine, but only while my user is logged in on system.</p>
  
  <p>How can i load my deamon-app, which will stay loaded without any user logged into the system (like the windows-services)??</p>
  
  <p>The command <code>sudo launchctl load /Library/LaunchDaemons/myPlistFileName</code> give me an error -> <em>nothing found to load</em></p>
  
  <p>Which is the right way to do this?</p>
  
  <hr>
  
  <p>EDIT: My Plist-File</p>
  
  <pre><code>&lt;key&gt;Label&lt;/key&gt;
  &lt;string&gt;com.myCompany.myApplication&lt;/string&gt;
  &lt;key&gt;ProgramArguments&lt;/key&gt;
  &lt;array&gt;
      &lt;string&gt;open&lt;/string&gt;
      &lt;string&gt;-g&lt;/string&gt;
      &lt;string&gt;/Applications/myAppDir/myApplication.app&lt;/string&gt;
  &lt;/array&gt;
  &lt;key&gt;UserName&lt;/key&gt;
  &lt;string&gt;root&lt;/string&gt;
  &lt;key&gt;GroupName&lt;/key&gt;
  &lt;string&gt;wheel&lt;/string&gt;
  &lt;key&gt;KeepAlive&lt;/key&gt;
  &lt;true/&gt;
  &lt;key&gt;OnDemand&lt;/key&gt;
  &lt;false/&gt;
  </code></pre>
  
  <p>Currently it is so: at system-start my daemon starts with root-permissions. After i've logged in with my user-account, the daemon-process restarts and my user is the new owner of the process</p>