从 application 打开 ghostty (gtk-launch) 会通过 dbus-notify 报错:remote peer disconnected。
AI 做出以下修复:
# ~/.config/systemd/user/app-com.mitchellh.ghostty.service.d/override.conf
[Service]
Type=notify
然后
systemctl daemon-reload --user
从 application 打开 ghostty (gtk-launch) 会通过 dbus-notify 报错:remote peer disconnected。
AI 做出以下修复:
# ~/.config/systemd/user/app-com.mitchellh.ghostty.service.d/override.conf
[Service]
Type=notify
然后
systemctl daemon-reload --user
我追踪到了https://github.com/ghostty-org/ghostty/issues/14398
你为什么会用gtk-launch打开程序而不是点击桌面启动器的图标打开程序呢?
另外我好奇的是,上述issue中特意提到When the app is D-Bus-reactivated。也就是说如果程序未释放dbus name,那么dbus activation启动特定的systemd service的时候,systemd会试图reload这个service?
原来已经 Merge 了,我忘记关github筛选漏掉了。那等 arch 更新应该就好了吧。
在我的认知里,KDE 启动器打开应用就是走的 gtk-launch。毕竟直接终端 ghostty 是正常的,只能通过 gtk-launch 来复现问题。
最后的问题,我确实不了解 DBus,不懂 systemd 和它交互的机制。
KDE的启动器不用gtk-launch,那个启动逻辑是它自己做的(它不会触发dbus activation)。
那个issue里的说法是dbus activation会触发这个bug,所以gtk-launch会触发,但是终端直接启动不会触发。
追了一下pr,原来是只要app-com.mitchellh.ghostty.service启动,就会因为程序在注册SIGUSR2 handler之前告诉systemd自己已启动,未遵守协议被杀死。所以合并的pr调整了一下代码,在告诉systemd自己启动好了之前注册SIGUSER2 handler。
这样一来就不好说KDE启动器会不会触发这个bug,不知道它在有同名non transisent service的情况下会是什么行为。感觉上应该直接启动non transisent service。
原来 KDE 不用 gtk-launch 吗,我被 AI 误导了。
说起来,KDE 启动和 gtk-launch 的行为还不太一样。KDE 启动会有个 notify remote peer disconnected,gtk-launch 就什么都没有,返回非0