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?


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.

  • 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 '14 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. – Dennis Kaarsemaker Jan 12 '14 at 10:35
  • isn't there a way to change a java process name from the outside? – vivi Jan 13 '14 at 5:00
  • No, there isn't any. – Dennis Kaarsemaker Jan 13 '14 at 7:55

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.