FW: Cannot find process

Net Llama! netllama
Tue Oct 17 08:20:44 PDT 2006


On Tue, 17 Oct 2006, Mike Reinehr wrote:
> Dirk,
>
> On Tuesday 17 October 2006 08:16, Dirk Moolman wrote:
>> -----Original Message-----
>> From: linux-users-bounces at linux-sxs.org
>> [mailto:linux-users-bounces at linux-sxs.org] On Behalf Of Vu Pham
>> Sent: 13 October 2006 04:57 PM
>> To: Linux tips and tricks
>> Subject: RE: FW: Cannot find process
>>
>> On Fri, 2006-10-13 at 16:31 +0200, Dirk Moolman wrote:
>>>>> When we start the process (it does not run in the background), and
>>>
>>> open
>>>
>>>>> another session, and do a "ps -ef | grep <processname>", the
>>
>> process
>>
>>>>> does not show.
>>>>
>>>> Did you login as root? Only root can see everything.
>>>
>>> Yes, I normally work as the root user (though it is probably not the
>>> best practise)
>>> I do this as root - I sometimes write crons that will check if
>>
>> processes
>>
>>> are running, and if not, start them.    We migrated from Solaris to
>>> Linux, and on Solaris this worked fine, but now the ps -ef does not
>>
>> work
>>
>>> properly on our SLES9 system.
>>>
>>>
>>>
>>> Have you tried other options like ps -aux ?
>>> I had similar problem on an old Redhat box.
>>
>> Nope, this one also doesn't work.  So far all the ps options I tried,
>> fail to show the process I am trying to find.
>>
>> Example:
>>
>> Let's say the script is called run.sh
>> I then open a ssh session (using putty), and run ./run.sh
>>
>> I open another ssh session, and so a "ps -ef | grep run"
>> ... but it doesn't find anything
>
> Instead of grep'ing for run.sh, have you tried examining the entire output of
> `ps -ef`? I was just looking at the output of `ps -ef`, here, and I could see
> the sshd process, started by init, and then by examining the PID's & PPID's
> could see the individual ssh sessions spawned by sshd, followed by the
> processes spawned by each individual ssh session--starting with bash.
>
> What sort of output are you seeing?

Indeed, "ps -ef" output is truncated after so many characters.  If you 
want to grep for run.sh, you should be running "ps auxww".  Note that ps 
deprecated the - a long time ago.  You shouldn't assume that Sun's ps 
works the same as GNU ps.  They do not.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lonni J Friedman                        netllama at linux-sxs.org
LlamaLand				http://netllama.linux-sxs.org



More information about the Linux-users mailing list