Running a script from a script in android

二次信任 提交于 2019-12-23 02:55:09

问题


i am trying to use an init.d script to execute another script in the background. The init.d script must continue immediatly after executing the other script in the background so my device can boot completely and then the executed script can do its commands. I have googled and found that the & symbol can be used at the end of the script name to execute it in the background. This worked, but my init.d script waited until the background script was finished. So i googled some more, and found that nohup command in use with & will do what i want. Perfect. HOWEVER when i used terminal emulator on android, i typed, nohup and i get "nohup: applet not found"

So as above i have no way of continuing the init.d script without it waiting for the background script. I am asking, Does anyone know how to run a script in the background while continuing the current script on android?

Or, does anybody know if i can add the "nohup" applet to my android device?

Thanks again to all who reply!


回答1:


You can use daemonize to run your script:

Usage: daemonize [-f logfile] [-a] [-d delay] <program>


来源:https://stackoverflow.com/questions/10037357/running-a-script-from-a-script-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!