1

I'm trying to track down this script called ./launch.sh, that on my machine is currently in an infinite loop in which it calls a Java program, immediately crashes, then sleeps for 3 seconds.

ps aux includes:

   31337  0.1  0.1  19716  2180 pts/3    S+   15:13   0:00 bash   
root     31621  0.3  0.3  22912  5492 pts/4    Ss+  15:15   0:00 -bash
root     31810  0.0  0.0   5872   604 pts/1    S+   15:16   0:00 sleep 3
root     31811  0.0  0.0  16872  1268 pts/2    R+   15:16   0:00 ps aux

As well as many -bash.

My launch script was called via ./launch.sh. This script does not begin with a shebang.

Linux version is as follows:

Linux version 3.2.0-23-virtual (buildd@crested) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu4) ) #36-Ubuntu SMP 

So basically wondering why launch.sh doesn't show up in ps aux, or if there's a way to find it more easily in the process list. It took me a while to realize I simply had this running in the foreground somewhere.

1

1 Answer 1

2

A script invoked as ./launch.sh will simply show up as bash (or whatever your default shell is) in ps's output.

To find out with PID is associated with your script, you can use lsof, which lists the processes that opened the file.

Example output:

$ lsof launch.sh 
COMMAND   PID   USER   FD   TYPE DEVICE SIZE/OFF    NODE NAME
bash    17085 dennis  254r   REG    8,1       28 2500332 launch.sh
$
$ ps up 17085
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
dennis   17085  0.0  0.1  28292  4260 pts/2    S+   11:28   0:00 bash

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .