Page 1 of 1

Starting with launchd on OSX server 10.10

Posted: January 22nd, 2016, 10:20 am
by mbabauer
I am trying to get sab to start on a Mac Mini i5 w/ 8gb RAM running 10.10 (El Capitan) and OS X Server 5.0.15.

I first downloaded the OS X package for SAB and dropped it into /Applications. Just make things easy, I launched it once as my user and configured everything to ensure it was working well, which created some config/ini files in /Users/<myuser>/Library/Application Support/SABnzbd.

I then created a new user `sabnzbd` in my Open Directory, logged in to make sure the proper folders were created in /Users/sabnzbd, then moved the generated files from launching it as myself over to this users ~/Library, chowned them appropriately, and created the following launchd script:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>com.sabnzbd.daemon</string>
   <key>ProgramArguments</key>
   <array>
      <string>/Applications/SABnzbd.app/Contents/MacOS/SABnzbd</string>
      <string>-f</string>
      <string>/Users/sabnzbd/Library/Application Support/SABnzbd/sabnzbd.ini</string>
   </array>
   <key>UserName</key>
   <string>sabnzbd</string>
   <key>WorkingDirectory</key>
   <string>/Users/sabnzbd</string>
   <key>RunAtLoad</key>
   <true/>
</dict>
</plist>
But, when I ran it, nothing happens. So I tried running the following as the `sabnzbd` user from CLI:

Code: Select all

/Applications/SABnzbd.app/Contents/MacOS/SABnzbd -f /Users/sabnzbd/Library/Application Support/SABnzbd/sabnzbd.ini
But it hangs for a LONG time, then finally I get:
INFO:root:Console logging for OSX App disabled
2016-01-22 09:37:18,143::INFO::[SABnzbd:1255] Console logging for OSX App disabled
Even a Ctrl-C did not quit, so I end up having to kill the process running. I then tried adding `-w 1`, and I get the same hang w/ the following output:
Jan 22 10:09:26 SABnzbd[25903] <Error>: Set a breakpoint at CGSLogError to catch errors as they are logged.
Jan 22 10:09:26 SABnzbd[25903] <Error>: This user is not allowed access to the window system right now.
INFO:root:Console logging for OSX App disabled
2016-01-22 10:09:26,294::INFO::[SABnzbd:1255] Console logging for OSX App disabled
Again, Ctrl-C is still not working, so I have to kill it directly.

How can I troubleshoot what's going on here?

Re: Starting with launchd on OSX server 10.10

Posted: January 22nd, 2016, 3:59 pm
by shypike
There might be an issue with IPv6.
To get more info, use the --console parameter.
Try to disable IPv6 with the extra parameter --no_ipv6

Re: Starting with launchd on OSX server 10.10

Posted: January 22nd, 2016, 5:56 pm
by mbabauer
Turned out to be a permissions issue that was solved after I restarted.