David C. Rankin wrote: <snip>
I get this new message:
[00:08 archangel:/etc] # noc fstab bash: /usr/local/bin/noc: /bin/bash: bad interpreter: Text file busy
<snip>
Text file busy?? It's a text file, it's not busy, it's either saved or you get what was present the last time it was saved, but it certainly isn't busy.
<snip>
"Text file busy" is not related with text files :)
Text refers to the "text section" of the executable. The text section of an executable is where the code resides, in other words the real program.
This message appears when a process is running and you try to overwrite it, for example:
[root@gerardo ~]# lsof -n | grep "sbin/init"
init 1 root txt REG 8,1 31352 1079262 /sbin/init <<< note the 'txt' at 4th field.
[root@gerardo ~]# echo 'hola' > /sbin/init
-bash: /sbin/init: Text file busy
But in this case is different, you are open(2) a file in read/write mode (O_RDWR), and you tried to execute it execve(2). This is impossible.
Again lsof help to view this:
[djgera@gerardo ~]$ vi coco.sh
[djgera@gerardo ~]$ lsof -n | grep coco.sh
vi 4127 djgera 4uW REG 8,6 32 113481 /home/djgera/coco.sh #### see the 'W' in 4th field.
[djgera@gerardo ~]$ ./coco.sh
bash: ./coco.sh: /bin/bash: bad interpreter: Text file busy
Another simple example:
[djgera@gerardo ~]$ cat coco.sh
#!/bin/bash
echo "Hola mundo!"
[djgera@gerardo ~]$ cat coco.c
#include