Skip to content

Instantly share code, notes, and snippets.

@bthompson-nd
Created February 6, 2017 15:14
Show Gist options
  • Save bthompson-nd/f4a168451d32daf8e324303976824eb8 to your computer and use it in GitHub Desktop.
Save bthompson-nd/f4a168451d32daf8e324303976824eb8 to your computer and use it in GitHub Desktop.
A systemd ActiveMQ service file for CentOS 7 and Red Hat 7
[Unit]
Description=ActiveMQ Message Broker
After=syslog.target network.target
[Service]
Type=forking
PIDFile="/opt/activemq/data/activemq.pid"
ExecStart="/opt/activemq/bin/start"
ExecStop="/opt/activemq/bin/stop"
ExecReload="/opt/activemq/bin/restart"
User=activemq
Group=activemq
[Install]
WantedBy=multi-user.target
@bthompson-nd
Copy link
Author

bthompson-nd commented Feb 6, 2017

This requires the manual creation of shell scripts "start" "stop" and "restart" in the bin directory, and the creation of an activemq user to own the /opt/activemq directory.

$ cat /opt/activemq/bin/start
#!/bin/bash
/opt/activemq/bin/activemq start >/dev/null 2>&1
$ cat /opt/activemq/bin/stop
#!/bin/bash
/opt/activemq/bin/activemq stop >/dev/null 2>&1
$ cat /opt/activemq/bin/restart
#!/bin/bash
/opt/activemq/bin/activemq restart >/dev/null 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment