Running a command whenever Mac boots up with launchctl/plist I need to run nohup nice synergys -f --config ~/bin/conf/synergy.conf &amp; command whenever the computer boots up.  

As is written in this post, I came up with the following plist code.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd &gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;synergy&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;nohup nice /usr/bin/synergys -f --config /Users/USER/bin/conf/synergy.conf &amp;&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;LaunchOnlyOnce&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


And, ran this command.

launchctl load ./synergy.plist 


However, I got this error message.

launchctl: no plist was returned for: ./synergy.plist
launchctl: no plist was returned for: ./synergy.plist
nothing found to load


What's wrong with my plist? Or is my launchctrl command wrong in options?
The immediate problem is that your .plist file isn't correctly formatted -- the contents of &lt;string&gt;...&lt;/string&gt; should be encoded with HTML entities, i.e. &amp; needs to be encoded as &amp;amp; (note: you can check the format of .plist files with plutil -lint filename.plist).  But there are some other changes that need to be made...

Starting programs with launchd is rather different than starting them from a shell.  The biggest difference is that from the shell, you want the program to go into the background and run independently of the shell, so you wrap it in nohup ... &amp;.  With launchd, it's actually best for the program to stay in the "foreground" so launchd can keep an eye on it.

Also, the elements of ProgramArguments won't get parsed by a shell, so listing the command and its arguments with spaces between them doesn't work -- make each argument a separate element of the array.

Here's my stab at a synergy .plist.  I haven't tested this, so it may need a little tweaking to work properly (see notes below):

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd &gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;local.synergy&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/usr/bin/synergys&lt;/string&gt;
        &lt;string&gt;-f&lt;/string&gt;
        &lt;string&gt;--config&lt;/string&gt;
        &lt;string&gt;/Users/USER/bin/conf/synergy.conf&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Nice&lt;/key&gt;
    &lt;integer&gt;10&lt;/integer&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;false/&gt;
    &lt;key&gt;AbandonProcessGroup&lt;/key&gt;
    &lt;true/&gt;
&lt;/dict&gt;
&lt;/plist&gt;


The last two keys above deal with how launchd should react if/when the synergys program exits.  By default, it kills any surviving subprocesses and launches a new instance; these two keys supress both parts, which may or may not be what you want.  Also, one thing this doesn't do that your version with nohup does is redirect stdin and stdout to nohup.out (in case the terminal goes away); instead IIRC launchd logs things that get sent to them.  If synergys is in the habbit of sending output, you might want to add something like this to the .plist:

    &lt;key&gt;StandardOutPath&lt;/key&gt;
    &lt;string&gt;/dev/null&lt;/string&gt;
    &lt;key&gt;StandardErrorPath&lt;/key&gt;
    &lt;string&gt;/dev/null&lt;/string&gt;


Also, as mankoff said, you should put this in ~/Library/LaunchAgents so it'll be autoloaded every time you log in.  Oh, and you should probably add a local. prefix to the filename (as I did with the label) to conform to the reverse-DNS naming convention.