0

I am trying to change a java process name using the start-stop-daemon. When running the process without the daemon I simply add to the script: "exec -a kuku" And the java process name in the proc file is changed to kuku. I read about the start-stop-daemon and didn't find a way to change the name, can someone help me?

1 Answer 1

0

start-stop-daemon has no functionality to do this. You will need to somehow call the libc function prctl(PR_SET_NAME, "name_here", 0, 0, 0) from your java code to achieve this.

4
  • and if i want to change the name from the outside, without touching the java code? i want to use it as a black box
    – vivi
    Jan 12, 2014 at 10:31
  • There is no way of doing that. You can only set the process name when calling execve() (which is what the bash exec function does) or from inside the process using that prctl. Jan 12, 2014 at 10:35
  • isn't there a way to change a java process name from the outside?
    – vivi
    Jan 13, 2014 at 5:00
  • No, there isn't any. Jan 13, 2014 at 7:55

You must log in to answer this question.

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