Score:2

After Reboot of machine, startup script raise one server, but one stays down. When i manually start script both servers starts fine

ms flag
#!/bin/bash
###BEGIN INIT INFO
#chkconfig: 12345 98 13
#Provides:          ACE
#Required-Start:    $local_fs
#Required-Stop:     $local_fs
#Default-Start:     2 3 4 5
#Default-Stop:      0 1 6
#Short-Description: IBM ACE Control
#Description:       IBM-ACE
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/bin
ACE_OWNR="root"
STARTUP=/root/IBM/Startup.log
#WLOG_START=/dev/null
STOP=/root/IBM/Stop.log
touch $STARTUP
touch $STOP
/bin/chown root:root $STARTUP
/bin/chown root:root $STOP

start() {
   echo "Startovanje Queue Manager"
   /opt/mqm/bin/strmqm QMPROD1
   echo "Startovan Queue Manager"
   sleep 2
   echo "Startovanje IBM ACE"
   /opt/ace-12.0.4.0/server/bin/mqsistart IIBPROD1
   sleep 2
   echo "Startovan IBM ACE(Svaka Cast)"
}

stop() {
   echo "Stopiranje IBM ACE"
   /opt/ace-12.0.4.0/server/bin/mqsistop IIBPROD1
   echo "Stopiran IBM ACE"
   sleep 2
   echo "Stopiranje Queue Manager"
   /opt/mqm/bin/endmqm QMPROD1
   sleep 2
   echo "Stopiran Queue Manager"
}

case "$1" in
   start) start ;;
   stop)  stop;;
   *) echo "usage $0 start|stop" >&2
      exit
      ;;
esac

Here is my script.I put it in runlevels 12345 as S98 and K13 But when i reboot it, only QM starts ACE stays down My OS is Centos 8.

Ginnungagap avatar
gu flag
Running the script by hand means you're running it when the OS is fully booted, your service script is started as the machine boots so some services won't be up yet. What do the logs say?
Boro avatar
ms flag
Litteraly nothing. When i reboot machine, and when connecting to machine, script in runlevels never execute. Like they are not there.
Ginnungagap avatar
gu flag
What does `systemctl status {scriptname}.service` say?
Boro avatar
ms flag
Oh, i found out that i have it as a service, but error is /etc/rc.d/init.d/hello: line 2: /root/ispis.txt: Permission denied
Boro avatar
ms flag
Do i need to disable SELinux to make it work?
Score:0
cn flag

You probably have to work on managing your script/service via systemd.

The following URL can be used as a starting point:

https://www.suse.com/support/kb/doc/?id=000019672

Score:0
ms flag

I found the answer, I already have script created via systemd, and that was for Queue Manager, and in above script just deleted parts where QM was mentioned. The main and biggest change that i made was disabling SELinux in /etc/selinux/config file, Change the line SELINUX=enforcing to SELINUX=disabled, Reboot machine, and everything worked fine. Haven't found solution for starting scripts after reboot whit SELINUX enable.

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.