FW: Cannot find process

Roger Oberholtzer roger
Tue Oct 17 08:13:15 PDT 2006


Does the script start another program? If the script starts a program in
the background, the script could finish and exit, leaving the other
program running, not the script.

When you run the script, do you get a prompt again? Or does the program
keep running so you cannot type more commands?

If a program is running in the foreground, you can type ctrl-Z. This
puts it in the background.  A simple 'ps' will then show the program.

What is the very first line in the script? It is something like

	#!some_program

If so, the first item after the #! ('some_program' in my example) is the
program that will run the script, and the one you should look for in
process lists. The script file you ran or even a shell will not be what
you will see. It will be 'some_program'.

On Tue, 2006-10-17 at 15:16 +0200, 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
> 
> 
> 
> Disclaimer: http://196.33.167.70/disclaimer
> 
> 
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc: http://mail.linux-sxs.org/cgi-bin/mailman/listinfo/linux-users
> 
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
-- 
Roger Oberholtzer

OPQ Systems AB
Ramb?ll Sverige AB
Kapellgr?nd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden

Tel: Int +46 8-615 60 20
Fax: Int +46 8-31 42 23




More information about the Linux-users mailing list