是否可以在 OpenWRT 中安装超时 [英] Is it possible to install timeout in OpenWRT

查看:48
本文介绍了是否可以在 OpenWRT 中安装超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 OpenWRT 中执行一个带有超时的命令,但似乎默认情况下没有安装命令超时,也不能使用 opkg 安装.我知道我可以做一个解决方法(使用命令 &; sleep $DELAY; kill $!),但我希望更正确地执行此操作,而不会冒着尝试杀死进程的风险,以防命令在命令之前完成超时.

I need to execute a command with a timeout in OpenWRT, but it seems that the command timeout is not installed by default neither can be installed using opkg. I know that I can do a work around (using command &; sleep $DELAY; kill $!), but I wish to do this more properly without getting the risk of kill trying to kill a process in case the command finished before the timeout.

推荐答案

简而言之:这是不可能的.我必须使用 sleep &&杀死.

In short: it is not possible. I have to do it using sleep && kill.

这篇关于是否可以在 OpenWRT 中安装超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆