Last active
October 16, 2024 18:37
-
-
Save negokaz/fb6c2496939feeb929b14a785cc73e24 to your computer and use it in GitHub Desktop.
This file contains 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