[GH-ISSUE #688] 在OpenWrt中运行二进制文件会导致openwrt的reboot、poweroff命令无法使用 #4779

Closed
opened 2026-03-01 15:36:05 +03:00 by kerem · 5 comments
Owner

Originally created by @LemonCrab666 on GitHub (Oct 30, 2024).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/688

在Immortalwrt 23.05.4中使用nginx-ui设置为开机运行nohup /opt/nginx-ui/nginx-ui -config /opt/nginx-ui/app.ini后会导致openwrt无法重启关机,并且没有系统日志,请重新测试下

Originally created by @LemonCrab666 on GitHub (Oct 30, 2024). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/688 在Immortalwrt 23.05.4中使用nginx-ui设置为开机运行nohup /opt/nginx-ui/nginx-ui -config /opt/nginx-ui/app.ini后会导致openwrt无法重启关机,并且没有系统日志,请重新测试下
kerem 2026-03-01 15:36:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@0xJacky commented on GitHub (Oct 30, 2024):

你好,以下的是我的操作步骤:

  1. 下载镜像文件 https://firmware-selector.immortalwrt.org/?version=23.05.4&target=x86%2F64&id=generic

  2. 创建虚拟机,使用 qcow2 作为硬盘

  3. 配置 Openwrt 网络 /etc/config/network 使得系统可以连接网络

  4. 下载 nginx-ui x86-64 linux 版本可执行文件(beta.39)到 /opt/nginx-ui 目录下

  5. 执行 opkg update 和 opkg install coreutils-nohup 安装 nohup

  6. 使用 nohup /opt/nginx-ui/nginx-ui -config /opt/nginx-ui/app.ini & 命令启动 nginx-ui
    image

  7. 网页可以正常加载,Openwrt 终端工作正常,可以使用 reboot,poweroff 命令。

<!-- gh-comment-id:2446164566 --> @0xJacky commented on GitHub (Oct 30, 2024): 你好,以下的是我的操作步骤: 1. 下载镜像文件 https://firmware-selector.immortalwrt.org/?version=23.05.4&target=x86%2F64&id=generic 2. 创建虚拟机,使用 qcow2 作为硬盘 3. 配置 Openwrt 网络 /etc/config/network 使得系统可以连接网络 4. 下载 nginx-ui x86-64 linux 版本可执行文件(beta.39)到 /opt/nginx-ui 目录下 5. 执行 opkg update 和 opkg install coreutils-nohup 安装 nohup 6. 使用 `nohup /opt/nginx-ui/nginx-ui -config /opt/nginx-ui/app.ini &` 命令启动 nginx-ui <img width="539" alt="image" src="https://github.com/user-attachments/assets/9125f276-a841-4f54-a210-efac83c635c0"> 7. 网页可以正常加载,Openwrt 终端工作正常,可以使用 reboot,poweroff 命令。
Author
Owner

@0xJacky commented on GitHub (Oct 30, 2024):

推测是由于您配置错误,结尾漏了个 & 导致终端卡在了这条命令上,所有输入都无法生效,基于这个情况,你可以使用 Control+C 退出回到终端,这样应该可以正常执行命令。重新配置你的开机启动脚本,应该就能解决问题。

<!-- gh-comment-id:2446168909 --> @0xJacky commented on GitHub (Oct 30, 2024): 推测是由于您配置错误,结尾漏了个 `&` 导致终端卡在了这条命令上,所有输入都无法生效,基于这个情况,你可以使用 Control+C 退出回到终端,这样应该可以正常执行命令。重新配置你的开机启动脚本,应该就能解决问题。
Author
Owner

@LemonCrab666 commented on GitHub (Oct 30, 2024):

推测是由于您配置错误,结尾漏了个 & 导致终端卡在了这条命令上,所有输入都无法生效,基于这个情况,你可以使用 Control+C 退出回到终端,这样应该可以正常执行命令。重新配置你的开机启动脚本,应该就能解决问题。

感谢,我再重新试下

<!-- gh-comment-id:2446193102 --> @LemonCrab666 commented on GitHub (Oct 30, 2024): > 推测是由于您配置错误,结尾漏了个 `&` 导致终端卡在了这条命令上,所有输入都无法生效,基于这个情况,你可以使用 Control+C 退出回到终端,这样应该可以正常执行命令。重新配置你的开机启动脚本,应该就能解决问题。 感谢,我再重新试下
Author
Owner

@0xJacky commented on GitHub (Oct 30, 2024):

补充说明一下,应该不是这样配置开机启动脚本的,稍等我看看

<!-- gh-comment-id:2446196277 --> @0xJacky commented on GitHub (Oct 30, 2024): 补充说明一下,应该不是这样配置开机启动脚本的,稍等我看看
Author
Owner

@0xJacky commented on GitHub (Oct 30, 2024):

请尝试社区贡献的方法

cat > "/etc/init.d/nginxui" << EOF
#!/bin/sh /etc/rc.common

START=99
STOP=10

USE_PROCD=1
PROG="/usr/bin/nginx-ui"
ARGS="-config /etc/nginx-ui/app.ini"

start_service() {
    procd_open_instance
    procd_set_param command "$PROG" $ARGS
    procd_set_param stdout 1
    procd_set_param stderr 1
    procd_set_param respawn
    procd_close_instance
}

stop_service() {
    killall nginx-ui
}

restart() {
    stop
    start
}
EOF

chmod +x /etc/init.d/nginxui
  1. https://www.reddit.com/r/linux/comments/1bmcsz0/howto_nginxui_on_openwrt_without_building/
  2. https://github.com/0xJacky/nginx-ui/issues/335
<!-- gh-comment-id:2446201818 --> @0xJacky commented on GitHub (Oct 30, 2024): 请尝试社区贡献的方法 ``` cat > "/etc/init.d/nginxui" << EOF #!/bin/sh /etc/rc.common START=99 STOP=10 USE_PROCD=1 PROG="/usr/bin/nginx-ui" ARGS="-config /etc/nginx-ui/app.ini" start_service() { procd_open_instance procd_set_param command "$PROG" $ARGS procd_set_param stdout 1 procd_set_param stderr 1 procd_set_param respawn procd_close_instance } stop_service() { killall nginx-ui } restart() { stop start } EOF chmod +x /etc/init.d/nginxui ``` 1. https://www.reddit.com/r/linux/comments/1bmcsz0/howto_nginxui_on_openwrt_without_building/ 2. https://github.com/0xJacky/nginx-ui/issues/335
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#4779
No description provided.