How to set process name for Leiningen script so htop shows it as "lein" and not "java... "?

29 views Asked by At

How to set the process name for Leiningen script so htop shows it as "lein" and not "java... "?

Every Leiningen process shows as "java -D..."

I tried:

#!/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

and:

# 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

I tried these code samples, but the are not installed by default and not working anyway.

0

There are 0 answers