From 8571569afc26a410af3b04c11bc7413063ae5bb2 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 30 Jul 2018 19:33:51 -0700 Subject: [PATCH] mac installer: change pkill() calls to killall() because pkill() was not available before OS 10.8 --- mac_installer/AddRemoveUser.cpp | 2 +- mac_installer/PostInstall.cpp | 4 ++-- mac_installer/uninstall.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mac_installer/AddRemoveUser.cpp b/mac_installer/AddRemoveUser.cpp index 079466b8fc..ce7f9c2f22 100644 --- a/mac_installer/AddRemoveUser.cpp +++ b/mac_installer/AddRemoveUser.cpp @@ -543,7 +543,7 @@ Boolean SetLoginItemLaunchAgent(long brandID, Boolean deleteLogInItem, passwd *p // To guard against this, we have the LaunchAgent kill the Manager // (for this user only) if it is running. // - fprintf(f, "pkill -9 -U %d \"%s\";", pw->pw_uid, appName[brandID]); + fprintf(f, "killall -u %d -9 \"%s\";", pw->pw_uid, appName[brandID]); } else { fprintf(f, "osascript -e 'tell application \"System Events\" to make login item at end with properties {path:\"%s\", hidden:true, name:\"%s\"}';", appPath[brandID], appName[brandID]); fprintf(f, "open -jg \"%s\";", appPath[brandID]); diff --git a/mac_installer/PostInstall.cpp b/mac_installer/PostInstall.cpp index e1c1ace505..e6686aa6f4 100644 --- a/mac_installer/PostInstall.cpp +++ b/mac_installer/PostInstall.cpp @@ -236,7 +236,7 @@ int main(int argc, char *argv[]) } for (i=0; i< NUMBRANDS; i++) { - snprintf(s, sizeof(s), "pkill \"%s\"", appName[i]); + snprintf(s, sizeof(s), "killall \"%s\"", appName[i]); callPosixSpawn (s); } sleep(2); @@ -1120,7 +1120,7 @@ Boolean SetLoginItemLaunchAgent(long brandID, long oldBrandID, Boolean deleteLog // To guard against this, we have the LaunchAgent kill the Manager // (for this user only) if it is running. // - fprintf(f, "pkill -9 -U %d \"%s\";", pw->pw_uid, appName[oldBrandID]); + fprintf(f, "killall -u %d -9 \"%s\";", pw->pw_uid, appName[oldBrandID]); } else { fprintf(f, "osascript -e 'tell application \"System Events\" to make login item at end with properties {path:\"%s\", hidden:true, name:\"%s\"}';", appPath[brandID], appName[brandID]); fprintf(f, "open -jg \"%s\";", appPath[brandID]); diff --git a/mac_installer/uninstall.cpp b/mac_installer/uninstall.cpp index d1fb6a2cb5..51b28bc917 100644 --- a/mac_installer/uninstall.cpp +++ b/mac_installer/uninstall.cpp @@ -386,12 +386,12 @@ static OSStatus DoUninstall(void) { } // With fast user switching, each logged in user can be running - // a separate copy of the Manager; pkill terminates all of them + // a separate copy of the Manager; killall terminates all of them for (i=0; ipw_uid, appName[brandID]); + fprintf(f, "killall -u %d -9 \"%s\";", pw->pw_uid, appName[brandID]); fprintf(f, "rm -f ~/Library/LaunchAgents/edu.berkeley.boinc.plist\n"); fprintf(f, "\t\n"); fprintf(f, "\tRunAtLoad\n");