简体   繁体   English

当我用 wait=FALSE 调用 system() 时进程被终止

[英]Process get terminated when I call system() with wait=FALSE

I'm trying to process videos on OpenCPU and because they are very big I want to call the "FFmpeg" process using "system" and allow it to keep working until it's done.我正在尝试在 OpenCPU 上处理视频,因为它们非常大,所以我想使用“系统”调用“FFmpeg”进程,并让它继续工作直到完成。 But I need to get the temporary "file directory" created by OpenCPU so I can pull that directory until the video conversion is done.但我需要获取由 OpenCPU 创建的临时“文件目录”,以便我可以拉取该目录,直到视频转换完成。 In order to do that i call the system function with the parameter wait=FALSE as shown bellow为此,我使用参数 wait=FALSE 调用系统 function,如下所示

This work fine if I use the library(opencpu) on my machine, but when I move this into the production environment (Ubuntu 14.x) the system call get interrupted just after starting.如果我在我的机器上使用库(opencpu),这个工作正常,但是当我将它移动到生产环境(Ubuntu 14.x)时,系统调用在启动后立即中断。

Is this something that can be fixed using opencpu.confg?这是可以使用 opencpu.confg 修复的问题吗? Or is it a bug?或者这是一个错误?

ffmpeg_exe <- "/usr/bin/ffmpeg" # Linux path

exec_convert <- paste0("( ",ffmpeg_exe,' -i ',input_file,' ',convert_command,' ',output_file, ' 2> PROCESS_OUTPUT.txt ;  ls > PROCESS_DONE.txt ',")")

system(exec_convert, wait=FALSE)

I just found out that on linux, OpenCPU does not allow for this behavior, It kills all child processes when the request returns.我刚刚发现在 linux 上,OpenCPU 不允许这种行为,它会在请求返回时杀死所有子进程。 This is on purpose.这是故意的。 It doesn't want orphan processes to run potentially forever on the server, opencpu is not designed for that purpose.它不希望孤立进程在服务器上永远运行,opencpu 不是为此目的而设计的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从外部应用程序调用构建R服务器REST API所需的建议吗? - Suggestions needed for building R server REST API's that I can call from external app? 如何连接安装在 RHEL/centOS 平台上的远程 Opencpu 服务器并使用 opencpu JS 从 R 获取结果? - How can I connect remote Opencpu server installed in RHEL/centOS platform and use opencpu JS to get results from R? 如何使用ocpu.r_fun_call? - How to use ocpu.r_fun_call? Openshift命令以非零退出代码终止:在Docker容器中执行错误:137 - Openshift command terminated with non-zero exit code: Error executing in Docker Container: 137 在OpenCPU云服务器中,对R函数的rpc调用没有响应,尽管在单用户服务器中运行良好 - rpc call to R function is not responding in case of OpenCPU cloud server, although it is working fine in single user server 如何在R中的json中获取我的结果的输出 - How to get the ouput of my result in json in R 在云中托管 R 时的内存要求 - Memory requirements when hosting R in the cloud opencpu:如何将脚本与数据框一起传递,并获取结果 - opencpu: how to pass a script along with the data frame, and get back results R包中的错误get(“rgeos”,envir = .MAPTOOLS_CACHE):找不到对象&#39;rgeos&#39; - R package Error in get(“rgeos”, envir = .MAPTOOLS_CACHE) : object 'rgeos' not found 如何为OpenCPU应用程序设置域名? - How do I set a domain name to an OpenCPU app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM