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