-
-
Save knalli/b7117309092eaaae7c748e680e7b5d5e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/jstatd.service | |
# | |
# Install: | |
# - Put this file on /etc/systemd/system/jstatd.service | |
# - Rewrite <host ip> | |
# | |
# Usage: | |
# sudo systemctl enable jstatd | |
# sudo systemctl start jstatd | |
# | |
[Unit] | |
Description=Monitors Java Virtual Machines (JVMs) and enables remote monitoring tools to attach to JVMs. | |
[Service] | |
Type = simple | |
ExecStartPre = /bin/bash -c "echo -e 'grant { permission java.security.AllPermission; };' > /etc/jstatd.policy" | |
ExecStart = /usr/bin/jstatd -J-Djava.security.policy=/etc/jstatd.policy -J-Djava.rmi.server.hostname=<host ip> | |
[Install] | |
WantedBy = multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment