Skip to content

Tools for MacOS

David Anderson edited this page Jun 15, 2024 · 5 revisions

Several tools are available for Macintosh System Administrators, mostly in the form of command-line shell scripts to be run from the Terminal application. Please read the comments in each script for descriptions and directions.

Running BOINC as a daemon or system service

Make_BOINC_Service.sh is a command-line shell script to set up the BOINC Client to run as a daemon at system startup. It can be used with either full GUI installations (BOINC Manager) or the stand-alone BOINC Client. (If you don't use the boinc daemon that came with the GUI installation, you should check the /Library/LaunchDaemons/edu.berkeley.boinc file that the Make_BOINC_Service.sh script generates for double slashes (//) and remove them if necessary.)

When run as a daemon:

  • The BOINC Client always runs even when no user is logged in. However, it still observes the Activity settings as set by the Manager or the Boinccmd_tool (Run always, Run based on preferences, Suspend, Snooze; Network activity always available, Network activity based on preferences, Network activity suspended.)
  • Quitting the BOINC Manager will not cause the Client to exit.
  • Most projects have upgraded their graphics to version 6 and will display graphics properly on BOINC version 6.2 and later even when running as a daemon. However, older style (version 5) application graphics (including screen saver graphics) are not available when the Client runs as a daemon.
  • The BOINC Client may not successfully detect the presence of a GPU, so BOINC Project applications may not be able to use the GPU.
  • The following apply to the full GUI installation (BOINC Manager):
    • You may need BOINC version 6.2 or later to work properly as a daemon.
    • Normally, BOINC Manager starts up automatically when each user logs in. You can change this as explained below.
    • If you wish to block some users from using BOINC Manager, ''move'' it out of the /Applications directory into a directory with restricted permissions. Due to the Manager's internal permissions, you can ''move'' it but cannot ''copy'' it. See Client security for more information.

Disabling auto-launch of BOINC Manager

By default, BOINC Manager starts up automatically when each user logs in. You can override this behavior by removing the BOINC Manager Login Item for selected users, either via the Accounts System Preferences panel or by creating a nologinitems.txt file in the BOINC Data folder. This should be a plain text file containing a list of users to be excluded from auto-launch, one user name per line.

An easy way to create this file is to type the following in terminal, then edit the file to remove unwanted entries:

ls /Users > "/Library/Application Support/BOINC Data/nologinitems.txt"

After creating this file, run the installer. The installer will delete the Login Item for each user listed in the file. Entries which are not names of actual users are ignored (e.g., Shared, Deleted Users.)

Using BOINC's security features with the stand-alone BOINC Client

Beginning with version 5.5.4, the Macintosh BOINC Manager Installer implements additional security to protect your computer data from potential theft or accidental or malicious damage by limiting BOINC projects' access to your system and data, as described in Client security. We recommend that stand-alone BOINC Client installations also take advantage of this protection. You can do this by running the Mac_SA_Secure.sh command-line shell script after installing the stand-alone Client, and again any time you upgrade the Client.

Although we don't recommend it, you can remove these protections by running the Mac_SA_Insecure.sh script.

Moving BOINC Manager or BOINC Data Folder to a Different Drive

It is possible to run BOINC on the Mac with the BOINC Manager application or the BOINC Data folder on a drive other than the boot drive. This is complicated a bit by the need to set up the special permissions for BOINC's sandbox security, but it can be done. These instructions are provided with no warranty; use them at your own risk.

Here are instructions for moving both the application and the data (you can move either or both):

''Shortcut: instead of typing a path in the Terminal application, you can drag a folder or file from a Finder window onto the Terminal window. If you do this, omit the quotation marks around the path! ''

  1. Quit BOINC.

  2. If you only want to move the BOINC Manager application, skip to step 4.

Copy the BOINC Data directory from the "/Library/Application Support/" directory to the desired drive. Rename the original BOINC Data directory or move it to a different directory on your boot drive as a backup safety measure. In any case, you must now not have a "/Library/Application Support/BOINC Data" directory before the next step.

  1. Create a symbolic link to the new BOINC Data directory in place of the old one. Enter the following in the Terminal application: sudo ln -fhs "{newDataPath}/BOINC Data" "/Library/Application Support/BOINC Data" Substituting your new path for ''{newDataPath}''; for example: ''"/Volumes/newDrive/myData"''.

  2. If you only want to move the BOINC Data, skip to step 5.

Copy BOINCManager.app from "/Applications/BOINCManager.app" to the desired drive, and move the original into the trash. (The Finder may not show the filename extension ".app").

Create a symbolic link to the new copy in place of the old one. Enter the following in the Terminal application: sudo ln -fhs "{newAppPath}/BOINCManager.app" "/Applications/BOINCManager.app" Substituting your new path for ''{newAppPath}''; for example: ''"/Volumes/newDrive/myApps"''

  1. IMPORTANT: you must create symbolic links. Macintosh aliases created with the Finder will not work!

Note: according to this discussion, the target drive must have "Owners Enabled" set. This must be set before running the Mac_SA_Secure.sh script; otherwise the script won't be able to set proper ownership of BOINC's files. Here are two different ways to do this:

a) In Finder, Get Info for the target drive (command-i). At the bottom of the Info window, ensure that "Ignore ownership on this volume" is not checked. OR

b) In the Terminal application, enter: sudo /usr/sbin/vsdbutil -a "/Volumes/{name_of_drive}" substituting the name of the drive's volume for {name_of_drive}

You can check whether Owners are enabled or disabled for a volume by selecting the volume in the Disk Utility application

  1. Run the Mac_SA_Secure.sh script to set up proper permissions at the new locations. Enter the following in the Terminal application: cd "{newDataPath}/BOINC Data" sudo sh "{path}/Mac_SA_Secure.sh" where ''{newDataPath}'' is as above and ''{path}'' is the path to the Mac_SA_Secure.sh script. (As before, you can drag the Mac_SA_Secure.sh file from a Finder window onto the Terminal window instead of typing its path.)

  2. Relaunch BOINC.

For safety, always make a backup copy of your BOINC Data before performing these steps.

Selecting which users may run BOINC Manager

Due to new restrictions imposed by OS 10.6 Snow Leopard, there has been a change in BOINC's security implementation. Non-administrative users can no longer run BOINC Manager unless they are added to group boinc_master.

As of BOINC 6.10.5, the BOINC installer asks whether or not you wish to add all non-admin users to group boinc_master. (As before, the installer automatically adds all users with administrative privileges (i.e., users who are members of group admin) to group boinc_master.)

If you need more selective control over which users should be in group boinc_master, you can use the command-line tool AddRemoveUser.

To add user1, user2 and user3 to group boinc_master, enter the following in the Terminal application: sudo {path}/AddRemoveUser -a user1 user2 user3 where ''{path}'' is the path to the AddRemoveUser application. This also sets a login item for each specified user so that BOINC Manager will start automatically when that user logs in.

You can also use: sudo {path}/AddRemoveUser -s user1 user2 user3 This is the same as the -an option and also sets BOINC as the screensaver for the specified users.

To remove user1, user2 and user3 from group boinc_master, enter the following in the Terminal application: sudo {path}/AddRemoveUser -r user1 user2 user3 This also removes the BOINCManager login item for each specified user. If any of the specified users had BOINC set as their screensaver, it will change their screensaver to Flurry.

Installing BOINC on a Mac using the command line

In some situations, such as remote or automated installs, it is more convenient to install BOINC Manager via the command line instead of the GUI. But there is no way to respond to dialogs during a command-line install.

Apple's command-line installer sets the following environment variable: COMMAND_LINE_INSTALL=1 The postinstall script, postupgrade script, and this Postinstall.app detect this environment variable and do the following:

  • Redirect the Postinstall.app log output to a file ''/tmp/BOINCInstallLog.txt''.
  • Suppress the 2 dialogs (asking whether to allow non-admin users to manage BOINC and whether to use the BOINC screensaver.)
  • test for the existence of a file ''/tmp/nonadminusersok.txt''; if the file exists, allow non-administrative users to run BOINC Manager.
  • test for the existence of a file ''/tmp/setboincsaver.txt''; if the file exists, set BOINC as the screensaver for all BOINC users.

The BOINC installer package to be used for command line installs can be found embedded inside the GUI BOINC Installer application at: "..../BOINC Installer.app/Contents/Resources/BOINC.pkg" Example: To install on a remote Mac from the command line, allowing non-admin users to run the BOINC Manager and setting BOINC as the screensaver: First SCP the "BOINC Installer.app" to the remote Mac's /tmp directory, then SSh into the remote Mac and enter the following: $ touch /tmp/nonadminusersok.txt $ touch /tmp/setboincsaver.txt $ sudo installer -pkg "/tmp/BOINC Installer.app/Contents/Resources/BOINC.pkg" -tgt /Applications $ sudo reboot

Clone this wiki locally