Apple - What is the "lsd" process on OS X, and why is it using so much CPU power?
lsd in OS X is indeed the LaunchServiceDaemon. launchd is a launch daemon manager! It provides probably the same function as in iOS. According to Apple it provides
support for launching apps and matching document types to apps. As a result, the keys recognized by Launch Services allow you to specify the desired execution environment for your bundled code.
lsd was apparently introduced in OS X 10.11 El Capitan because I can't find it in older systems. The latest version (included in 10.11.2) should have the mod date Dec 3, 2015.
To troubleshoot
the "LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist" problem check this post:
Probably not the best way, but I seem to have fixed/suppressed that error message. This is what I did:
cd /private/var/db
lsd directory did not exist
mkdir lsd
Still no joy
chmod -R 777 /private/var/db/lsd
(i know, i just opened up my gibson to being hacked)
touch /private/var/db/lsd/com.apple.lsdschemes.plist
Seemed to go away after that. Willing to bet a disk repair/permissions check will break it again, but have not tried. If I cat that file the following is the content:
bplist00?
the 100 % CPU-usage: /usr/libexec/lsd using 100% of CPU
It seems that lsd
gets stuck on _LSCreateRegistrationData for a certain app. If you're having the same issue, follow the guide below.
- Open activity monitor and search for
lsd
- Get the PID of the
lsd
owned by theroot
user - Open the terminal
- Enter
sudo sample PID-HERE
(Of course, replacing PID-HERE with the PID you got in step 2) - If you're having the same issue, there should be something about
_LSCreateRegistrationData
in the call graph (near the top of the whole output) - Enter
sudo lsof -p PID-HERE
You should be able to recognise an app package within that output. Try deleting or updating it and see if it solves the issue
I too discovered that I had problems with lsd. It seems that it is enough to create the directory and touch the file, there was (at least in my case) no need to fiddle with the permissions as described by klanomath.
In my case, it did stop the lsd errors, but I was still seeing frequent errors like these:
Feb 25 14:06:07 iMac system_profiler[259]: LaunchServices: Database mapping failed with result -10822, retrying
Feb 25 14:06:07 iMac system_profiler[259]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
Feb 25 14:06:07 iMac com.apple.xpc.launchd[1] (com.nomachine.nxserver): Service only ran for 7 seconds. Pushing respawn out by 3 seconds.
I had an installation of NoMachine and deleting that (since I only ever really did use the nxplayer anyway), that error stopped as well.