System message getting printed after every command execution
Hi,
I am getting this error message after every command i type in ####################### $ls file1 file2 -bash: /root/.o_cmd: Read-only file system ####################### now i figure that there is some background process(lets say P) that is always running after each command i execute . the file in /root/.o_cmd is not set with executable permissions, hence i am getting prompted with that error. Now i wanted to look up the options as what this process "P" is. i would really appreciate if some one could throw in some suggestion like smpp? PAM ? or any methods of finding out the "P" process.. thanks to all off you ... :-) |
The same message for ANY command?
Does the command work and then you get that message? What is the value of $PS1? What is the 7th field of the affected user(s) /etc/passwd line? Does this affect all users? If only one user, have you tried renaming the shell initialisation files for this user in the user's home directory? |
Q.The same message for ANY command?
The same message for any command Q.Does the command work and then you get that message? the commands work without any problem Q.What is the value of $PS1? #echo $PS1 [\u@\h \W]\$ -bash: /root/.o_cmd: Read-only file system by the way what is $PS1 Q.What is the 7th field of the affected user(s) /etc/passwd line? The seventh field in the passwd file is /bin/bash "root:x:0:0:root:/root:/bin/bash" Q.Does this affect all users? No, only the root user Q.If only one user, have you tried renaming the shell initialisation files for this user in the user's home directory? The only shell intialization file there is .bashrc and that thing is the default .bashrc that every other user has. Thanks for the reply |
Quote:
PS1 defines the command line interface prompt. What happens if you rename .o_cmd? Do you know where .o_cmd came from? What is the output of Code:
file ~/.o_cmd |
This is the only command that actually looked weird of the bunch
# file .o_cmd Bus error -bash: /root/.o_cmd: Read-only file system #cksum /bin/bash 659698809 616248 /bin/bash -bash: /root/.o_cmd: Read-only file system # /bin/bash --version GNU bash, version 3.00.15(1)-release (i386-redhat-linux-gnu) Copyright (C) 2004 Free Software Foundation, Inc. -bash: /root/.o_cmd: Read-only file system /bin/ls -ld /bin/bash -rwxr-xr-x 1 root root 616248 Apr 12 2006 /bin/bash -bash: /root/.o_cmd: Read-only file system |
Thanks for more info.
This is, so far, very puzzling. I have no idea why /bin/bash is trying to run /root/.o_cmd after every command or how it could be configured to do so. Perhaps this is normal for /bin/bash on your system or perhaps /bin/bash is modified. It would be nice to compare the checksum from an identical system. Let's look for a call to .o_cmd in bash. What is the output from Code:
strings /bin/bash | grep cmd Code:
cmd_init Code:
/usr/bin/df -hT |
An idea ... what's the output from
Code:
trap -p |
What is output of
Code:
echo "$PROMPT_COMMAND" From bash manual: Code:
PROMPT_COMMAND |
Thanks Valery Reznic :) Good to learn about it and could be the cause.
|
Got it
Valery Reznic, thanks,, i got that .. awesome.. now i know where to look from here ; "logme" being the culprit..
and catkin, thanks for all the help.. ########################################### # echo $PROMPT_COMMAND echo -n $(logme) -bash: /root/.o_cmd: Read-only file system # echo $(logme) -bash: /root/.o_cmd: Read-only file system -bash: /root/.o_cmd: Read-only file system # trap -p -bash: /root/.o_cmd: Read-only file system ########################################## |
You are welcome. Some time ago I was burned pretty bad by PROMPT_COMMAND -
some command didn't return correct exit status. After a lot of digging it's turns out that someone wanted to do something funny with prompt and used PROMPT_COMMAND. And in this setup, if you run command and then Code:
command After that I decided that I never will use it. |
Quote:
But where is $PROMPT_COMMAND set? If root's "personal" bash initialisation files are the same as the other users' then root's shell is being customised in the same way as the other users so there must be something in the bash initialisation files specific to root such as (example from /etc/profile) Code:
# For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in What is logme and why how does running it invoke /root/.o_cmd which results in a message about a read-only file system? |
Maybe this one passed unnoticed. Why this?
Code:
# file .o_cmd |
hi colucix,
yeah ,, still no idea why that bus error occured ?? :-/ and hi catkin, As it turns out this linux machine is a heavely customised linux IVR voice server. This server is used together with a bunch of infra server(a cluster actually). This server has to connect to these clusters as soon as it boots up. As these are critical systems, some one thought that it would be a good idea to keep checking from time to time if its connection with the cluster are good or not(This messages-one liner-was supposed to be printed after each command executed ), and also log everything that the root user types in.. that o_cmd that we have is actually a script that does the logging thing.. hence its being called... how its does the logging for root is another story i guess.. would love to share that script here,, but have to get permissions from my overlords .. :-) ... If that fails then i will print the important part of the code some time later... |
Quote:
It still looks as if something is broken, though, and the .o_cmd script is not working as intended. Regards the bus error tha colucix pointed out and other error messages it might be helpful to have the output of Code:
/usr/bin/df -hT |
All times are GMT -5. The time now is 11:41 PM. |