Score:0

Created Startup Script but i'm not authorized to perform the requested operation

ms flag

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?

JoshMc avatar
ar flag
Normally you would start mq as the mqm user not root. ACE can run as any user as long as it has the right permissions granted, normally this would not be root. In general you world not want to run applications as root. I would suggest setting up two didn't services (mqm and ace). You can make ace dependent on mqm. You would not create both a service file and an init.d script. systemd will just convert the init.d into a service so it will likely conflict with the actual service. The service file can specify a user to run as and a environment file to use.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.