activemq,redis开机自启动
1. 新建一个系统服务文件
vi /etc/systemd/system/activemq.service
复制粘贴以下内容:
[Unit]
Description=activemq-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/apache-activemq-5.15.11/bin/activemq start
ExecReload=/usr/local/apache-activemq-5.15.11/bin/activemq restart
ExecStop=/usr/local/apache-activemq-5.15.11/bin/activemq stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
注:上面的ExecStart改成你activemq安装的位置
2. 重载系统服务
systemctl daemon-reload
3. 设置redis服务开机自启动
systemctl enable redis-server.service
重启服务器试一下服务是否可以正常启动。