Startup Script
#!/bin/bash
#Short-Description: IBM ACE Control
#Description: IBM-ACE
start() {
echo "Startovanje Queue Manager"
/opt/mqm/bin/strmqm QMPROD1
#/opt/mqm/bin/strmqm %I
echo "Startovan Queue Manager" >> /root/pom.txt
echo "Startovanje IBM ACE" >> /root/pom.txt
cd /opt/ace-12.0.4.0/server/bin/
echo -n "Usao u folder"
mqsistart IIBPROD1
echo "Startovan IBM ACE(Svaka Cast)" >> /root/pom.txt
}
stop() {
echo "Stopiranje IBM ACE"
cd /opt/ace-12.0.4.0/server/bin/
mqsistop IIBPROD1
echo "Stopiran IBM ACE" >> /root/pom.txt
echo "Stopiranje Queue Manager" >> /root/pom.txt
/opt/mqm/bin/endmqm QMPROD1
echo "Stopiran Queue Manager" >> /root/pom.txt
}
case "$1" in
start) start ;;
stop) stop;;
*) echo "usage $0 start|stop" >&2
exit
;;
esac
ace.service
[Unit]
Description=Startovanje ACE-a
After=network.target
[Service]
ExecStart=/etc/init.d/ibmace.sh start
ExecStop=/etc/init.d/ibmace.sh stop
Type=forking
KillMode=none
LimitNOFILE=10240
LimitNPROC=4096
[Install]
WantedBy=multi.user.target
I don't know what Type=forking means and below components so maybe need to edit that. When i created script and service and put script in /etc/init.d/, create sym link to rc*.d(all), put S99 and K10 for starting and stopping. In bash_profile added this two lines and do the source
export PATH
. /opt/ace-12.0.4.0/server/bin/mqsiprofile
. /opt/mqm/bin/setmqenv -s
After reboot, in pom.txt it's show like it's started, but when i do systemctl status ace.service
output is
[root@ct-tre-iib ~]# systemctl status ace.service
● ace.service - Startovanje ACE-a
Loaded: loaded (/etc/systemd/system/ace.service; enabled; vendor preset: disabled)
Active: inactive (dead)
ct-tre-iib ibmace.sh[4438]: Startovanje Queue Manager
ct-tre-iib ibmace.sh[4439]: AMQ7077E: You are not authorized to perform the requested operation.
ct-tre-iib ibmace.sh[4438]: Usao u folder
ct-tre-iib ibmace.sh[4442]: Usao u folder
ct-tre-iib ibmace.sh[4442]: etc/init.d/ibmace.sh: line 13: mqsistart: comma
ct-tre-iib ibmace.sh[4443]: Stopiranje IBM ACE
ct-tre-iib ibmace.sh[4446]: /etc/init.d/ibmace.sh: line 20: mqsistop: command not found
ct-tre-iib ibmace.sh[4447]: AMQ7077E: You are not authorized to perform the requested operation.
ct-tre-iib systemd[1]: ace.service: Succeeded.
ct-tre-iib systemd[1]: Started Startovanje ACE-a.
Also i have doubts about these two directories.
drwxr-xr-x. 10 root root 133 Oct 12 17:59 ace-12.0.4.0
dr-xr-xr-x. 21 mqm mqm 4096 Jun 7 21:23 mqm
Maybe i need to change owner from root user to mqm in ace.
What should i do next? Anyone?