Spotlight 无法打开:控制台显示:mds[pid](致命)服务器:mds 必须以 root 身份运行。退出

发布于 2024-12-21 21:04:41 字数 1061 浏览 1 评论 0原文

我关掉了聚光灯,并对此进行了非常彻底的研究。如此彻底以至于我无法将其重新打开。我需要从 Mac App Store 安装一个程序(&App Store 依赖于 mds),所以如果有人有关于如何在没有 mds 的情况下安装 App Store 程序的信息(聚光灯),那就更好了。

所以我的问题是聚光灯抱怨它只能以 root 身份运行,但我一生都无法弄清楚为什么不能。据我了解,只要具有正确的权限,/System/Library/LaunchDaemons 中的启动守护进程就会自动以 root 身份启动。该目录中的每个文件都是 rw-rr。以下是我用来从 launchd 卸载/加载 Spotlight 的命令:

sudo mdutil -a -E -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo rm -rf "/.Spotlight-V100"
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

我还重命名了 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support 中的 mds 可执行文件,添加了 .bak 扩展名。

要重新加载它,我基本上撤消了这些步骤。但是它现在不起作用。我在谷歌上搜索了错误,但没有骰子。我从 Snow Leopard 安装映像重新加载了 mds 二进制文件,但没有执行任何操作。我已经修复了 4-5 次权限,并手动查找树以查看是否注意到任何权限错误,但一切都是 root:wheel 755 就像我认为它应该位于 Frameworks 文件夹中,以及 LaunchDaemons 中的 rw-rr文件夹。然而,mds 不断向控制台发送消息: mds[pid](致命)服务器:mds 必须以 root 身份运行。退出。

有人知道发生了什么事吗?我现在不想重新格式化,因为我已经花了很长时间来设置这台计算机,而我只想从 App Store 安装一个程序。

谢谢!

I turned off spotlight and was very thorough about it. So thorough that I can't get it turned back on. I need to install a program from the Mac App Store (& App Store relies on mds), so if anyone has information on how to install an App Store program without mds at all (spotlight), that would be even better.

So my problem is that spotlight is complaining it can only run as root, but I can't for the life of me figure out why it isn't. From what I understand, launch daemons in /System/Library/LaunchDaemons are automatically launched as root as long as they have the correct permissions. Every file that directory is rw-r-r. Here are the commands I've been using to unload/load spotlight from launchd:

sudo mdutil -a -E -i off
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
sudo rm -rf "/.Spotlight-V100"
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

I also rename the mds executables in /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support, adding a .bak extension.

To reload it, I essentially undo those steps. However it's not working right now. I've searched for the error on google, but no dice. I reloaded the mds binaries from the Snow Leopard install image, didn't do anything. I've repaired permissions 4-5 times and manually looked up the tree to see if I noticed any permissions were wrong, but everything is root:wheel 755 like I assume it should be in the Frameworks folder, and rw-r-r in the LaunchDaemons folder. However mds is constantly spitting messages to the console that say
mds[pid] (Fatal) Server: mds must be run as root. exiting.

Anyone have any clue what is going on? I'd rather not reformat right now since I've put quite a long time into setting up this computer and I just want to install one program from the App Store.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉生梦死 2024-12-28 21:04:41

好吧,当我崩溃并发布 SO 我找到解决方案时,你难道不知道吗:我找到了某人的聚光灯启用脚本并将其粘贴到我的终端中。重新启动,聚光灯工作,安装程序,再次禁用聚光灯。这就是我使用的:

sudo chmod 775 /Library/Spotlight;
sudo chmod 755 /System/Library/Spotlight;
sudo chmod 755 /System/Library/PreferencePanes/Spotlight.prefPane;
sudo chmod 755 /System/Library/Services/Spotlight.service;
sudo chmod 755 /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight;
sudo chmod 555 /usr/bin/mdimport;
sudo chmod 555 /usr/bin/mdcheckschema;
sudo chmod 555 /usr/bin/mdfind;
sudo chmod 555 /usr/bin/mdls;
sudo chmod 555 /usr/bin/mdutil;
sudo chmod 555 /usr/bin/md;

正如 Thilo 指出的,这与编程无关,因此可以将其移至超级用户或任何其他更好的东西。

Well, wouldn't you know as soon as I break down and post on SO I find the solution: I found someone's spotlight-enable script and pasted it into my terminal. Rebooted, spotlight working, installed program, disabled spotlight again. This is what I used:

sudo chmod 775 /Library/Spotlight;
sudo chmod 755 /System/Library/Spotlight;
sudo chmod 755 /System/Library/PreferencePanes/Spotlight.prefPane;
sudo chmod 755 /System/Library/Services/Spotlight.service;
sudo chmod 755 /System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight;
sudo chmod 555 /usr/bin/mdimport;
sudo chmod 555 /usr/bin/mdcheckschema;
sudo chmod 555 /usr/bin/mdfind;
sudo chmod 555 /usr/bin/mdls;
sudo chmod 555 /usr/bin/mdutil;
sudo chmod 555 /usr/bin/md;

As Thilo pointed out, this isn't really programming related so it can be moved to Super User or whatever else anyone things is better.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文