Systemctl for JBoss in RHEL7

1) Prepare file /etc/systemd/system/jboss.service

[Unit]
Description=JBoss Startup
After=multi-user.target

[Service]
User=jboss
Group=jboss
ExecStart=/appl/jboss/bin/standalone.sh -b myhost.mycompany.com
ExecStop=/appl/jboss/bin/jboss-cli.sh –controller=:9999 –connect shutdown
Restart=no

[Install]
WantedBy=multi-user.target

 

2) Enable the service from systemctl
systemctl enable jboss
systemctl daemon-reload

 

3) Test
systemctl start jboss
systemctl status jboss -l

systemctl stop jboss
systemctl status jboss -l

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s