Find the answer to your Linux question:
Results 1 to 5 of 5
I have a script that invokes a java application. when i issue a "ps", i see the command name to be "java" for the process i started. How do i ...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    3

    assign a name to a process

    I have a script that invokes a java application. when i issue a "ps", i see the command name to be "java" for the process i started.
    How do i assign a user defined process name?

  2. #2
    Just Joined! mitchpotter's Avatar
    Join Date
    Jan 2008
    Location
    Orlando
    Posts
    19
    What kind of script is it and could you post the line where you start the process?

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    This is correct. The reason for this is that Java executables are not fully compiled: when you execute a Java application, you are actually executing the Java JIT compiler, which compiles the executable and runs it.

    However, if you run a command like "java SomeProgram", the ps output should be "java SomeProgram". Therefore, you can use something like "pgrep -f SomeProgram" to determine the PID, and kill it that way.

    Does that help?
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined!
    Join Date
    Apr 2008
    Posts
    3
    It is a simple java program that is invoked by the shell script. i would like to know if i can assign a process name to the script that i invoke.

  5. #5
    Just Joined!
    Join Date
    Apr 2008
    Posts
    3
    Thank you. Yes, i know that we can use the pgrep. but, i would like to know if i can assign a user defined process name to the script that i invoke.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...