Search code examples
macoslaunchctl

launchctl process showing non-zero exit code


I'm trying to run a launchctl process that runs a simple python script (that opens a browser window) on my mac but it's not running. Here's are the steps I'm taking:

  1. save plist file to ~/Library/LaunchAgents
  2. launchctl unload org.name.open-browser.plist
  3. launchctl load org.name.open-browser.plist
  4. launchctl start org.name.open-browser

However, the browser window isn't opening. When I run launchctl list org.name.open-browser I get the following output:

{
    "LimitLoadToSessionType" = "Aqua";
    "Label" = "org.brad.alpha";
    "TimeOut" = 30;
    "OnDemand" = true;
    "LastExitStatus" = 19968;
    "Program" = "python3";
    "ProgramArguments" = (
        "python3";
        "/Users/BradsMacbookPro/Documents/open_fb.py";
    );
};

That LastExitStatus should be 0 right? What does 19968 mean? And what might I be doing wrong here?

I have a mid-2014 macbook pro running OSX El Capitan. Maybe upgrading to Sierra might help?


Solution

  • You have to specify the full path to the executable for example

    "Program" = "/usr/bin/python3"