1826443 Members
4061 Online
109692 Solutions
New Discussion

Re: strace understanding

 
Sivasingam Santhakumar
Frequent Advisor

strace understanding

I have two RH AS2.1 servers running on DL380 g4. When I ssh to the servers and log out one server close my putty session other one just sits there w/o closing my putty session. I ran strace on the pid my session on both servers and I get this:

From the server that closes putty:

fstat64(3, {st_mode=S_IFREG|0600, st_size=1038, ...}) = 0
brk(0x80f3000) = 0x80f3000
read(3, "su -\nexit\nsudo netstat -an |grep"..., 1038) = 1038
close(3) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
ioctl(255, TIOCSPGRP, [26442]) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
setpgid(0, 26442) = -1 EPERM (Operation not permitted)
_exit(0) = ?
Process 26442 detached

Server that doesn't close putty:

fstat64(3, {st_mode=S_IFREG|0600, st_size=2677, ...}) = 0
brk(0x80f3000) = 0x80f3000
read(3, "sudo vi /etc/php.ini\nsudo locate"..., 2677) = 2677
close(3) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD TSTP TTIN TTOU], [], 8) = 0
ioctl(255, TIOCSPGRP, [15334]) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
setpgid(0, 15334) = -1 EPERM (Operation not permitted)
_exit(0) = ?
Process 15334 detached

The line I don't understand is:
sudo vi /etc/php.ini\nsudo locate
I have nothing to do with php.ini file. I don't know where is it getting from?.
Any ideas?

Thanks
Santha
1 REPLY 1
Patrick Lampert_1
Occasional Advisor

Re: strace understanding

Which shell are you using? I traced an exit and a logout command from a putty window logged into a RHEL 3 box and don't see any sudo commands. Are you using a .bashlogout script or if you're not using bash, some other script that executes during logout/exit?

As for the sudo command - This appears to be two commands separated by a new line \n

sudo vi /etc/php.ini

followed by

sudo locate

You can find out more on sudo and locate from the man pages.