rc.local会阻塞直到命令执行完毕吗? [英] Will rc.local block until command finish execution?
本文介绍了rc.local会阻塞直到命令执行完毕吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
rc.local将等待每个命令完成,还是像exec()一样执行命令?
Will rc.local wait for each command to finish, or the commands are executed like exec() ?
推荐答案
这是一个普通的shell脚本.因此,根据脚本调用命令的方式(例如,是否使用&
),它们是否阻塞.
It's a normal shell script. So they block or not, according to how the script invokes the commands (e.g. with/without &
).
但是exec的工作方式也与您的思维方式不同; exec()
不会异步执行任何操作.
But exec also works differently to how you appear to think; exec()
doesn't do anything asynchronously.
这篇关于rc.local会阻塞直到命令执行完毕吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文