提问人:Audrius M 提问时间:8/30/2023 更新时间:8/30/2023 访问量:23
如何设置 Leiningen 脚本的进程名称,以便 htop 将其显示为“lein”而不是“java..."?
How to set process name for Leiningen script so htop shows it as "lein" and not "java... "?
问:
如何设置 Leiningen 脚本的进程名称,以便 htop 将其显示为“lein”而不是“java..."?
每个 Leiningen 进程都显示为“java -D...”
我试过了:
#!/bin/bash
# Set the process name to "lein"
if [ "$(uname)" == "Darwin" ]; then
# Use setproctitle to set the process name on macOS
if [ -n "$(command -v setproctitle)" ]; then
setproctitle "lein"
fi
fi
和:
# Set the process name to "lein"
if [ "$(uname)" == "Linux" ]; then
# Use prctl to set the process name on Linux
if [ -n "$(command -v prctl)" ]; then
prctl --set-name lein
fi
fi
我尝试了这些代码示例,但默认情况下没有安装,无论如何都无法正常工作。
答: 暂无答案
评论
[ a == b ]
[ a = b ]
exec -a argv0 cmd arg1 arg2 ...
lein
TRAMPOLINE_FILE
-a
JAVA_CMD
java
exec -a