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?
- Daemons and agents are background processes that are responsible for carrying out specific tasks in MacOS.
- Daemons are long-running processes that operate continuously, while agents are shorter-lived processes that are launched as needed by other applications.
- Daemons and agents may be running in the background for a variety of reasons.
- Some examples include the below services.
- Network services: Various network services like DNS, DHCP, and VPN are handled by system-level daemons.
- Maintenance tasks: MacOS regularly runs maintenance tasks in the background to keep the system optimized and to prevent any issues.
- Automatic updates: MacOS also has a software update daemon that can automatically download and install updates.
- 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?
- There are several ways to locate daemons and agents running in a MacOS computer background.
- We will introduce them below.
2.1 Activity Monitor.
- The easiest way to find daemons and agents is to use the built-in Activity Monitor app.
- This app displays a list of all running processes, including daemons and agents.
- To access Activity Monitor, follow these steps.
- Open Spotlight (Cmd+Space) and type ‘Activity Monitor‘.
- Click on the Activity Monitor application to launch it.
- Once Activity Monitor is open, click on the “CPU” tab in the top row.
- Click on “View” and select “All Processes, Hierarchically“.
- Scroll through the list of processes to find the ones labeled as daemons or agents.
- 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.
- Alternatively, you can use Terminal Commands to find daemons and agents.
- Here are some of the most useful commands:
- 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
- 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?
- In macOS, the daemon and agent plist files are saved in the Library directory of your user account.
- To access these folders, follow these steps.
- Open Finder.
- Click on “Go” from the menu bar.
- Click the Go to Folder… menu item in the drop-down menu list.
- Input the text “/Library” or “~/Library” in the Go to the folder input text box.
- Click the Go button to open the “/Library” or “~/Library” folder.
- Navigate to the “LaunchAgents” or “LaunchDaemons” folder, depending on which one you want to access.
- 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.
- 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.
- You can refer to the article Understanding the Content of macOS Daemon and Agent Plist Files to learn the plist file content.
- 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?
- 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.
- If you notice daemons or agents running that do not contribute to the functionality of your system, it’s best to disable them.
- 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.
- To disable a daemon or agent, follow these steps.
- Open Terminal and enter the command sudo launchctl unload -w /Library/LaunchDaemons/daemonname.plist.
- Replace “daemonname” with the name of the daemon you want to disable.
- Enter your administrator password when prompted.
4.2 Uninstall Unused Applications.
- Many third-party applications come bundled with their own daemons and agents.
- 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.
- Some daemons and agents may be launched at login as part of your user account’s “Login Items” list.
- To remove these items, follow these steps.
- Click on the Apple menu in the top-left corner of the screen.
- Select “System Preferences…“.
- Click on “Users & Groups“.
- Select your user account in the left-hand pane.
- Click on the “Login Items” tab.
- 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.
- Sometimes, you may not want to delete the background daemon or agent, you just want to stop it to run when macOS start up.
- In this case, you can move the daemons or agents’ plist files from the folder /Library/LaunchAgents or /Library/LaunchDaemons to a backup folder.
- 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.
- Although the daemon or agent process can not start when macOS initialize, you can start them manually later.
- 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.