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?
Asked
Active
Viewed 1,712 times
1 Answers
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.

Dennis Kaarsemaker
- 19,277
- 2
- 44
- 70
-
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 05:00
-
No, there isn't any. – Dennis Kaarsemaker Jan 13 '14 at 07:55