How To Find Daemons And Agents Running In macOS Background & Stop It

In MacOS, there are a number of daemons and agents that run in the background, performing various tasks to ensure the smooth functioning of the system. These processes can take up valuable system resources and affect overall performance if not managed properly. In this article, we will discuss how to find daemons and agents running in a MacOS background and stop them if necessary.

1. What Are Daemons And Agents?

  1. Daemons and agents are background processes that are responsible for carrying out specific tasks in MacOS.
  2. Daemons are long-running processes that operate continuously, while agents are shorter-lived processes that are launched as needed by other applications.
  3. Daemons and agents may be running in the background for a variety of reasons.
  4. Some examples include the below services.
  5. Network services: Various network services like DNS, DHCP, and VPN are handled by system-level daemons.
  6. Maintenance tasks: MacOS regularly runs maintenance tasks in the background to keep the system optimized and to prevent any issues.
  7. Automatic updates: MacOS also has a software update daemon that can automatically download and install updates.
  8. Third-party apps: Many third-party apps have their own daemons or agents that run in the background to provide additional functionality or support for specific features.

2. How To Find Daemons And Agents Running In macOS Background?

  1. There are several ways to locate daemons and agents running in a MacOS computer background.
  2. We will introduce them below.

2.1 Activity Monitor.

  1. The easiest way to find daemons and agents is to use the built-in Activity Monitor app.
  2. This app displays a list of all running processes, including daemons and agents.
  3. To access Activity Monitor, follow these steps.
  4. Open Spotlight (Cmd+Space) and type ‘Activity Monitor‘.
  5. Click on the Activity Monitor application to launch it.
  6. Once Activity Monitor is open, click on the “CPU” tab in the top row.
  7. Click on “View” and select “All Processes, Hierarchically“.
  8. Scroll through the list of processes to find the ones labeled as daemons or agents.
  9. The daemons or agents’ process user name is generally root, _windowserver, .etc or the process name ends with the character d such as launched, cloudd, bluetoothd.

2.2 Terminal Commands.

  1. Alternatively, you can use Terminal Commands to find daemons and agents.
  2. Here are some of the most useful commands:
  3. ps aux | grep -i daemon: This command shows a list of all running processes with “daemon” in their name.

     % ps aux|grep -i daemon
    _windowserver     242  62.4  1.1  5678888  94500   ??  Rs    7:47PM   4:53.20 /System/Library/PrivateFrameworks/SkyLight.framework/Resources/WindowServer -daemon
    jerry            1474   0.3  0.0  4268268    676 s000  S+    9:21PM   0:00.00 grep -i daemon
    root              957   0.0  0.0  4274756   2952   ??  Ss    8:22PM   0:00.02 /System/Library/CoreServices/ReportCrash daemon
    jerry             509   0.0  0.1  4315896   6976   ??  Ss    7:49PM   0:00.28 /System/Library/PrivateFrameworks/CloudDocsDaemon.framework/XPCServices/ContainerMetadataExtractor.xpc/Contents/MacOS/ContainerMetadataExtractor
    root              498   0.0  0.1  4284636   6352   ??  Ss    7:49PM   0:00.27 /System/Library/PrivateFrameworks/AppStoreDaemon.framework/Support/appstored
    jerry             471   0.0  0.2  4316280  19688   ??  S     7:49PM   0:00.61 /System/Library/PrivateFrameworks/HomeKitDaemon.framework/Support/homed
    jerry             446   0.0  0.2  4321516  15472   ??  S     7:48PM   0:00.77 /System/Library/PrivateFrameworks/AppStoreDaemon.framework/Support/appstoreagent
    jerry             373   0.0  0.2  4321552  19448   ??  S     7:48PM   0:03.10 /System/Library/PrivateFrameworks/CloudDocsDaemon.framework/Versions/A/Support/bird
    root              281   0.0  0.1  4284672   5484   ??  Ss    7:47PM   0:00.12 /System/Library/Frameworks/AudioToolbox.framework/AudioComponentRegistrar -daemon
    root              153   0.0  0.0  4283348   2920   ??  Ss    7:47PM   0:02.80 /usr/sbin/cfprefsd daemon
    _distnote         152   0.0  0.0  4283992   3504   ??  Ss    7:47PM   0:00.27 /usr/sbin/distnoted daemon
    root               99   0.0  0.1  4318884   8496   ??  Ss    7:47PM   0:01.48 /usr/sbin/systemstats --daemon
    
  4. launchctl list: This command displays a list of all active daemons, including those that are not currently running.

    $ sudo launchctl list
    Password:
    PID	Status	Label
    -	0	com.apple.storedownloadd.daemon
    382	0	com.apple.CoreAuthentication.daemon
    199	0	com.apple.coreservicesd
    -	0	com.apple.touchbarserver
    833	0	com.apple.deleted_helper
    -	0	com.apple.avbdeviced
    345	0	com.apple.cvmsServ
    -	0	com.apple.FontWorker
    -	0	com.apple.applessdstatistics
    -	0	com.apple.hdiejectd
    -	0	com.apple.corestorage.corestoraged

3. How Does macOS Launch Daemon And Agent Processes?

  1. In macOS, the daemon and agent plist files are saved in the Library directory of your user account.
  2. To access these folders, follow these steps.
  3. Open Finder.
  4. Click on “Go” from the menu bar.
  5. Click the Go to Folder… menu item in the drop-down menu list.
  6. Input the text “/Library” or “~/Library” in the Go to the folder input text box.
  7. Click the Go button to open the “/Library” or “~/Libraryfolder.
  8. Navigate to the “LaunchAgents” or “LaunchDaemons” folder, depending on which one you want to access.
  9. In the LaunchAgents or LaunchDaemons folder, you should be able to find the plist files that are used to start related macOS daemon or agent applications accordingly.
  10. When macOS is started and initialized, it will read the content in plist files that are saved in these 2 folders and start the related daemon or agent process defined in the plist files.
  11. You can refer to the article Understanding the Content of macOS Daemon and Agent Plist Files to learn the plist file content.
  12. Be careful when modifying or deleting files in these folders, as it can cause issues with your applications or system.

4. How To Manage macOS Daemons And Agents?

  1. Once you have identified which daemon or agent is causing issues with your system, you can take several steps to manage them.

4.1 Disable Unused Daemons And Agents.

  1. If you notice daemons or agents running that do not contribute to the functionality of your system, it’s best to disable them.
  2. Some daemons and agents may be necessary for the stability and security of your system, but many can be safely disabled without any negative impact.
  3. To disable a daemon or agent, follow these steps.
  4. Open Terminal and enter the command sudo launchctl unload -w /Library/LaunchDaemons/daemonname.plist.
  5. Replace “daemonname” with the name of the daemon you want to disable.
  6. Enter your administrator password when prompted.

4.2 Uninstall Unused Applications.

  1. Many third-party applications come bundled with their own daemons and agents.
  2. If you no longer use an application, consider uninstalling it to remove any associated background processes running on your system.

4.3 Delete Unused Login Items.

  1. Some daemons and agents may be launched at login as part of your user account’s “Login Items” list.
  2. To remove these items, follow these steps.
  3. Click on the Apple menu in the top-left corner of the screen.
  4. Select “System Preferences…“.
  5. Click on “Users & Groups“.
  6. Select your user account in the left-hand pane.
  7. Click on the “Login Items” tab.
  8. Select any daemons or agents that you wish to remove from the list and click the “” button to delete them.

5. How To Stop Background Daemons Or Agents Process To Run When macOS Startup.

  1. Sometimes, you may not want to delete the background daemon or agent, you just want to stop it to run when macOS start up.
  2. In this case, you can move the daemons or agents’ plist files from the folder /Library/LaunchAgents or /Library/LaunchDaemons to a backup folder.
  3. And then when macOS starts up, it can not read the related plist files in the folder /Library/LaunchAgents or /Library/LaunchDaemons, then it will not run the background daemon or agent process.
  4. Although the daemon or agent process can not start when macOS initialize, you can start them manually later.
  5. And you can move the plist files back to the folders /Library/LaunchAgents or /Library/LaunchDaemons when you want to run them as the system startup later.

In conclusion, understanding how to find and manage daemons and agents running in a MacOS background can help improve system performance and stability. Use Activity Monitor, and Terminal Commands to locate active processes, then take appropriate steps to disable unused daemons and agents, uninstall unused applications, and remove unused login items. With proper management, your MacOS system can run smoothly and efficiently.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.