cp: cannot create regular file `/usr/local/bin/orange': Text file busy
来源:互联网 发布:女生做春梦 知乎 编辑:程序博客网 时间:2024/06/11 17:34
问题:
发布新版本,进行可执行文件拷贝时,遇到问题:
cp: cannot create regular file `/usr/local/bin/orange’: Text file busy
原因:
可执行(进程自身代码)被进程占用,不允许被修改,尤其是覆盖。
解决办法:
方法一
a) 重命名老的文件;
b) 拷贝新的文件;
c) 进程重启,使用新的文件;
d) 删除老的文件;
When a file is opened and locked by a process, any other process is not allowed to write into it, and in particular to completely overwrite it. But anyone (with the necessary rights) can rename it.
Thus the procedure I usually follow in this case is:
1. rename the old file
2. copy the new file, with the old name of the existing one
3. once the file is unlocked, I delete it
Note that after the step 2, the locking process still operates on the renamed file, but any new process will refers to the new one!
方法二
a) 直接删除老文件
b) 拷贝新文件
c) 重启进程
No need to wait. You can remove the file right away. The kernel will keep the old file around on disk until no one is using it.
参考:
http://www.linuxquestions.org/questions/linux-general-1/cannot-create-regular-file-text-file-busy-731644/
- cp: cannot create regular file `/usr/local/bin/orange': Text file busy
- 异常/usr/bin/install: cannot create regular file `/usr/local/jpeg6/include/jconfig.h'
- cp: cannot create regular file '/media/lxl/wdd/boot/vxworks-cu2': Read-only file system
- tftp cannot open,Text file busy
- cannot create regular file `XXX': Permission denied
- Cannot remove entries from nonexistent file /usr/local/bin/anaconda2/lib/python2.7/site-packages/eas
- mkdir: cannot create directory `/usr/local/share/man/man1': File exists
- Text file busy
- Text file busy解决方法
- QT5 cannot find usr/local/lib, file format not recognized
- /usr/bin/ld:cannot open output file:Is a directory
- Text file busy(文本文件忙)
- 1.hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs': Permission denied
- hadoop3: mkdir: cannot create directory `/usr/local/hadoop/bin/../logs’: Permission denied
- Android studio中Git路径找不到(Mac版),提示Cannot run program "/usr/local/bin/git" error=2, No such file or dir
- /usr/local/tomcat/bin/catalina.sh: line 315: /usr/java/jdk1.6.0_12/bin/java: No such file or directo
- .sh文件中的首行 #!/bin/bash 以及 bad interpreter: Text file busy 文本文件忙错误
- JDK报错:-bash: /usr/local/java/bin/java: No such file or directory
- Linux系统命令提示符学习总结
- 几行代码道出了指针,类型转换,浮点存储,小端存储的本质
- 由年和周获得日期
- Spring技术内幕——深入解析Spring架构与设计原理(三)数据库的操作实现
- HTML鼠标移到a上面让a变色
- cp: cannot create regular file `/usr/local/bin/orange': Text file busy
- 内存对齐以及位域
- 数组类型
- 石子合并(一)
- MyEclipse-Maven编写WordCount时问题总结
- JSON的简介以及android 提供的JSON解析类
- Word自动生成书籍目录
- 负数的带符号和不带符号的移位运算
- python numpy包的使用一 基本操作