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
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– viviJan 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 bashexec
function does) or from inside the process using that prctl. Jan 12, 2014 at 10:35 -
-