MacOS – Editing com.apple.atrun.plist on El Capitan

launchdmacospermissionsip

I am running El Capitan on several computers and would like to be able to use at to run scheduled jobs in the background. Enabling at requires editing /System/Library/LaunchDaemon/com.apple.atrun.plist. Any way I have tried to do this, I have run into a permissions problem: using sudo, logging in as root or trying to change the permissions from the file information panel all result on a permissions error of some sort.

I have tried:

  1. sudo vi /System/Library/LaunchDaemon/com.apple.atrun.plist and not been able to save the edited file.
  2. Copying to file, editing it and copying back – I am not allowed to copy back using sudo.
  3. Using Xcode to edited the fiel through a GUI, cannot save.
  4. using Property List Editor, cannot save, even logged in as root.
  5. Changing owner, group is not allowed, even using sudo or logged in a root.
  6. Changing permissions of all the subdirectories in the tree above (System, System/Library, etc.) used sudo, also tried changed disk permissions.
  7. Run disk utility.

There must be some way of doing this, please advise.

Best Answer

The file com.apple.atrun.plist is protected by System Integrity Protection.

So boot to the Recovery HD partition (hold down Command + R while restarting), disable SIP and modify the item:

  1. In the menubar open Utilities->Terminal
  2. Enter csrutil disable
  3. Reboot to your main volume and edit the file
  4. Reboot into the Recovery Partition again
  5. Enable SIP again csrutil enable
  6. Reboot to your main volume
Related Question