libnyanpasu / clash-nyanpasu

Clash Nyanpasu~(∠・ω< )⌒☆​
https://nyanpasu.elaina.moe
GNU General Public License v3.0
9.62k stars 601 forks source link

[Bug] 1.5.2(dev) Linux 下服务模式无法正常安装 #1443

Closed kands-code closed 3 months ago

kands-code commented 3 months ago

复现步骤 / Step to reproduce

  1. 安装软件(deb/rpm)
  2. 点击 设置 -> System Service -> INSTALL

预期行为 / Expected behaviour

service 应该被正常安装

实际行为 / Actual Behaviour

由于服务的安装需要 root 权限,而不知什么原因,在点击 INSTALL 的时候并不会弹出密码请求,导致超时,服务安装自动失败

应用日志 / App logs

{"timestamp":"2024-08-27T23:20:02.099170Z","level":"ERROR","fields":{"message":"error sending request for url (https://api.ip.sb/geoip)","log.target":"app","log.module_path":"clash_nyanpasu::ipc","log.file":"tauri/src/ipc.rs","log.line":230},"target":"app","filename":"tauri/src/ipc.rs","line_number":230}
{"timestamp":"2024-08-27T23:20:17.196439Z","level":"ERROR","fields":{"message":"error sending request for url (https://api.ip.sb/geoip)","log.target":"app","log.module_path":"clash_nyanpasu::ipc","log.file":"tauri/src/ipc.rs","log.line":230},"target":"app","filename":"tauri/src/ipc.rs","line_number":230}
{"timestamp":"2024-08-27T23:22:00.446708Z","level":"ERROR","fields":{"message":"error sending request for url (https://api.ip.sb/geoip)","log.target":"app","log.module_path":"clash_nyanpasu::ipc","log.file":"tauri/src/ipc.rs","log.line":230},"target":"app","filename":"tauri/src/ipc.rs","line_number":230}
{"timestamp":"2024-08-27T23:26:03.575573Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":564},"target":"app","filename":"tauri/src/ipc.rs","line_number":564}
{"timestamp":"2024-08-27T23:26:08.571698Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":564},"target":"app","filename":"tauri/src/ipc.rs","line_number":564}
{"timestamp":"2024-08-27T23:27:58.682267Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":564},"target":"app","filename":"tauri/src/ipc.rs","line_number":564}
{"timestamp":"2024-08-27T23:35:21.542160Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":574},"target":"app","filename":"tauri/src/ipc.rs","line_number":574}
{"timestamp":"2024-08-27T23:35:26.338283Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":574},"target":"app","filename":"tauri/src/ipc.rs","line_number":574}
{"timestamp":"2024-08-27T23:35:28.172471Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }","log.target":"app","log.module_path":"clash_nyanpasu::core::clash::core","log.file":"tauri/src/core/clash/core.rs","log.line":191},"target":"app","filename":"tauri/src/core/clash/core.rs","line_number":191}
{"timestamp":"2024-08-27T23:35:28.172559Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }\n\n"},"target":"clash_nyanpasu::core::clash::core","filename":"tauri/src/core/clash/core.rs","line_number":206}
{"timestamp":"2024-08-27T23:35:35.324911Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":574},"target":"app","filename":"tauri/src/ipc.rs","line_number":574}
{"timestamp":"2024-08-27T23:35:35.330754Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }","log.target":"app","log.module_path":"clash_nyanpasu::core::clash::core","log.file":"tauri/src/core/clash/core.rs","log.line":191},"target":"app","filename":"tauri/src/core/clash/core.rs","line_number":191}
{"timestamp":"2024-08-27T23:35:35.330835Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }\n\n"},"target":"clash_nyanpasu::core::clash::core","filename":"tauri/src/core/clash/core.rs","line_number":206}
{"timestamp":"2024-08-27T23:35:40.614706Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }","log.target":"app","log.module_path":"clash_nyanpasu::core::clash::core","log.file":"tauri/src/core/clash/core.rs","log.line":191},"target":"app","filename":"tauri/src/core/clash/core.rs","line_number":191}
{"timestamp":"2024-08-27T23:35:40.614795Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }\n\n"},"target":"clash_nyanpasu::core::clash::core","filename":"tauri/src/core/clash/core.rs","line_number":206}
{"timestamp":"2024-08-27T23:35:49.464811Z","level":"WARN","fields":{"message":"Tried to initialize the wayland data control protocol clipboard, but failed. Falling back to the X11 clipboard protocol. The error was: Unknown error while interacting with the clipboard: A required Wayland protocol (zwlr_data_control_manager_v1 version 1) is not supported by the compositor","log.target":"arboard::platform::linux","log.module_path":"arboard::platform::linux","log.file":"/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arboard-3.4.0/src/platform/linux/mod.rs","log.line":88},"target":"arboard::platform::linux","filename":"/home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/arboard-3.4.0/src/platform/linux/mod.rs","line_number":88}
{"timestamp":"2024-08-27T23:36:05.741279Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":574},"target":"app","filename":"tauri/src/ipc.rs","line_number":574}
{"timestamp":"2024-08-27T23:36:05.747486Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }","log.target":"app","log.module_path":"clash_nyanpasu::core::clash::core","log.file":"tauri/src/core/clash/core.rs","log.line":191},"target":"app","filename":"tauri/src/core/clash/core.rs","line_number":191}
{"timestamp":"2024-08-27T23:36:05.747570Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }\n\n"},"target":"clash_nyanpasu::core::clash::core","filename":"tauri/src/core/clash/core.rs","line_number":206}
{"timestamp":"2024-08-27T23:36:40.782231Z","level":"ERROR","fields":{"message":"failed to install service, exit code: 1, signal: 0","log.target":"app","log.module_path":"clash_nyanpasu::ipc::service","log.file":"tauri/src/ipc.rs","log.line":574},"target":"app","filename":"tauri/src/ipc.rs","line_number":574}
{"timestamp":"2024-08-27T23:36:40.789243Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }","log.target":"app","log.module_path":"clash_nyanpasu::core::clash::core","log.file":"tauri/src/core/clash/core.rs","log.line":191},"target":"app","filename":"tauri/src/core/clash/core.rs","line_number":191}
{"timestamp":"2024-08-27T23:36:40.789349Z","level":"ERROR","fields":{"message":"core terminated with status: TerminatedPayload { code: Some(0), signal: None }\n\n"},"target":"clash_nyanpasu::core::clash::core","filename":"tauri/src/core/clash/core.rs","line_number":206}
{"timestamp":"2024-08-27T23:52:25.819012Z","level":"DEBUG","fields":{"message":"check config in `clash`","log.target":"app","log.module_path":"clash_nyanpasu::utils::resolve","log.file":"tauri/src/utils/resolve.rs","log.line":425},"target":"app","filename":"tauri/src/utils/resolve.rs","line_number":425}

备注 / Addition details

目前可以通过手动安装来安装服务

sudo /usr/bin/nyanpasu-service install --user 【用户名】 --nyanpasu-data-dir 【用户家目录】/.local/share/clash-nyanpasu --nyanpasu-config-dir 【用户家目录】/.config/clash-nyanpasu --nyanpasu-app-dir /usr/bin

但是安装后无法通过面板启动,仍需要手动启动

sudo /usr/bin/nyanpasu-service start

环境信息 / Environment information

----------- System ----------- OS: Linux Arch Linux 6.10.6-zen1-1-zen Arch: x86_64 ----------- Device ----------- CPU: AMD Ryzen 5 4600U with Radeon Graphics @ 2.42GHz x 12 Memory: 13.52 GiB ----------- Core ----------- mihomo: Mihomo Meta v1.18.7 linux amd64 with go1.22.5 Sun Jul 28 05:47:02 UTC 2024 Use tags: with_gvisor clash-rs: clash-rs 0.3.0 clash: Clash n2023-09-05-gdcc8d87 linux amd64 with go1.21.0 Tue Sep 5 14:21:14 UTC 2023 mihomo-alpha: Mihomo Meta alpha-8483178 linux amd64 with go1.23.0 Tue Aug 27 12:35:03 UTC 2024 Use tags: with_gvisor ----------- Build Info ----------- App Name: clash-nyanpasu App Version: 0.1.0 Pkg Version: 1.5.2-alpha+5099400 Commit Hash: 5099400f0f5bee907f94c7953e19f774e9ab420a Commit Author: Petard Jonson Commit Date: 2024-08-27T16:53:39.000Z Build Date: 2024-08-27T16:57:28.198Z Build Profile: Nightly Build Platform: x86_64-unknown-linux-gnu Rustc Version: rustc 1.82.0-nightly (515395af0 2024-08-26) Llvm Version: 19.1

自查步骤 / Verify steps

kands-code commented 3 months ago

我自己使用的是 deb 包安装,PKGBUILD 是我自己改的:

pkgname=clash-nyanpasu-bin
_pkgname=clash-nyanpasu
pkgver=1.5.2
_channel='-alpha'
_hash='+5099400'
pkgrel=1
pkgdesc='A Clash GUI based on tauri. Clash Nyanpasu~(∠・ω< )⌒☆​'
arch=('x86_64')
url='https://nyanpasu.elaina.moe/'
license=('GPL-3.0-only')
makedepends=('libarchive')
depends=('webkit2gtk' 'gtk3' 'libayatana-appindicator')
conflicts=('clash-nyanpasu-git' 'clash-nyanpasu-appimage' 'clash-nyanpasu')
provides=('clash-nyanpasu')
options=(!strip !zipman)
source=("https://github.com/LibNyanpasu/clash-nyanpasu/releases/download/pre-release/${_pkgname}_${pkgver}${_channel}${_hash}_amd64.deb")
sha256sums=('0c487aeee1142641c961a04cb8edf6dca26e52034ff0bedde91851e8b71f5d4a')
package() {
  # only extract
  bsdtar -xf data.tar.gz -C "${pkgdir}/"  
}

应该是没有问题的

greenhat616 commented 3 months ago

Linux 这里 GUI 提权我不熟,有什么办法能确保 Gui 的 sudo 必定弹框吗?

zty012 commented 2 months ago

Linux 这里 GUI 提权我不熟,有什么办法能确保 Gui 的 sudo 必定弹框吗?

pkexec

greenhat616 commented 2 months ago

Linux 这里 GUI 提权我不熟,有什么办法能确保 Gui 的 sudo 必定弹框吗?

pkexec

目前已经使用 pkexec 处理这个问题啦,谢谢!