mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-30 03:10:16 +08:00
fix: 将host-spawn替换为systemd-run --user以提升兼容性
This commit is contained in:
@@ -220,7 +220,7 @@ ipcMain.handle("open-install-settings", async () => {
|
|||||||
const { spawn } = await import("node:child_process");
|
const { spawn } = await import("node:child_process");
|
||||||
const scriptPath =
|
const scriptPath =
|
||||||
"/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh";
|
"/opt/durapps/spark-store/bin/update-upgrade/ss-update-controler.sh";
|
||||||
const child = spawn("/opt/spark-store/extras/host-spawn", [scriptPath], {
|
const child = spawn("systemd-run", ["--user", scriptPath], {
|
||||||
detached: true,
|
detached: true,
|
||||||
stdio: "ignore",
|
stdio: "ignore",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function launch_app() {
|
|||||||
# 提取并净化Exec命令
|
# 提取并净化Exec命令
|
||||||
exec_command=$(grep -m1 '^Exec=' "$DESKTOP_FILE_PATH" | cut -d= -f2- | sed 's/%.//g')
|
exec_command=$(grep -m1 '^Exec=' "$DESKTOP_FILE_PATH" | cut -d= -f2- | sed 's/%.//g')
|
||||||
[ -z "$exec_command" ] && return 1
|
[ -z "$exec_command" ] && return 1
|
||||||
[ ! -z "$IS_ACE_ENV" ] && HOST_PREFIX="host-spawn"
|
[ ! -z "$IS_ACE_ENV" ] && HOST_PREFIX="systemd-run --user"
|
||||||
exec_command="${HOST_PREFIX} $exec_command"
|
exec_command="${HOST_PREFIX} $exec_command"
|
||||||
log.info "Launching: $exec_command"
|
log.info "Launching: $exec_command"
|
||||||
${SHELL:-bash} -c " $exec_command" &
|
${SHELL:-bash} -c " $exec_command" &
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ function launch_app() {
|
|||||||
# 提取并净化Exec命令
|
# 提取并净化Exec命令
|
||||||
exec_command=$(grep -m1 '^Exec=' "$DESKTOP_FILE_PATH" | cut -d= -f2- | sed 's/%.//g')
|
exec_command=$(grep -m1 '^Exec=' "$DESKTOP_FILE_PATH" | cut -d= -f2- | sed 's/%.//g')
|
||||||
[ -z "$exec_command" ] && return 1
|
[ -z "$exec_command" ] && return 1
|
||||||
[ ! -z "$IS_ACE_ENV" ] && HOST_PREFIX="host-spawn"
|
[ ! -z "$IS_ACE_ENV" ] && HOST_PREFIX="systemd-run --user"
|
||||||
exec_command="${HOST_PREFIX} $exec_command"
|
exec_command="${HOST_PREFIX} $exec_command"
|
||||||
log.info "Launching: $exec_command"
|
log.info "Launching: $exec_command"
|
||||||
${SHELL:-bash} -c " $exec_command" &
|
${SHELL:-bash} -c " $exec_command" &
|
||||||
|
|||||||
Reference in New Issue
Block a user