From 831f7b317a500bd08881c54f075698fde60c5978 Mon Sep 17 00:00:00 2001 From: thebluepotato Date: Wed, 17 Jun 2020 22:09:55 +0200 Subject: [PATCH] Improve macOS install with better debug (#8958) --- install_service_macos | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/install_service_macos b/install_service_macos index 0415ac1ae..096e1105d 100755 --- a/install_service_macos +++ b/install_service_macos @@ -66,14 +66,29 @@ fi # Run the agent launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist -# Check that it's running +# Check that it's launched +userid=$(id -u) if [[ $(launchctl list | grep org.user.Jackett) ]]; then - echo "${BOLDGREEN}Agent successfully installed and launched!${NC}" -else - cat << EOL -${BOLDRED}ERROR${NC}: Could not launch agent. The installation might have failed. + if [[ $(launchctl print gui/${userid}/org.user.Jackett | grep 'state') =~ "running" ]]; then + echo "${BOLDGREEN}Agent successfully installed and running!${NC}" + echo "Jackett location: ${jackettdir}" + echo "Jackett agent:" + launchctl print gui/${userid}/org.user.Jackett | egrep 'state|pid |path|working' + else + cat << EOL +${BOLDRED}ERROR${NC}: Agent was loaded but is not running. The installation might have failed. Please open an issue on https://github.com/Jackett/Jackett/issues and paste following information: -Jackett directory: \`${jackettdir}\` +*Jackett directory*: ${jackettdir} +*launchctl info*: +$(launchctl print gui/${userid}/org.user.Jackett) +*LaunchAgents permissions*: +$(ls -la ~/Library/LaunchAgents | egrep ' \.|Jackett') EOL + fi +else + echo "${BOLDRED}ERROR${NC}: Agent could not be loaded. Please open an issue on https://github.com/Jackett/Jackett/issues and paste the output." + echo "*Jackett directory*: ${jackettdir}" + echo "*LaunchAgents permissions*:" + ls -la ~/Library/LaunchAgents | egrep ' \.|Jackett' fi