Last active
December 14, 2022 18:31
-
-
Save nkonev/1110431b45a399f950c3483bf6813135 to your computer and use it in GitHub Desktop.
systemctl GlassFish start script
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
[Unit] | |
Description=GlassFish Server | |
After=syslog.target network.target | |
[Service] | |
Type=forking | |
ExecStart=/opt/glassfish4/bin/asadmin start-domain domain1 | |
ExecStop=/opt/glassfish4/bin/asadmin stop-domain domain1 | |
TimeoutSec=180 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the systemctl start script I use on CentOS 7 to start GlassFish at system boot. Note that these instructions assume GlassFish is installed to /opt/glassfish4 and JAVA_HOME is set to /opt/java. Here are the steps. First, add this to the end of /opt/glassfish4/glassfish/config/asenv.conf:
AS_JAVA="/opt/java"
Next, copy the Gist contents to a new file: /usr/lib/systemd/system/glassfish.service.
Finally, run the commands:
systemctl daemon-reload
systemctl enable glassfish
systemctl start glassfish
If you are able to reboot the server, you might want to reboot to test that GlassFish starts at boot.
You can check GlassFish status anytime with:
systemctl status glassfish