0
my system runs on suse enterprise 12 sp2.
I have two services sapinit and sapcontrol. At startup the service sapinit has to be started before the sapcontrol service can start and at shutdown or stop the sapcontrol service has to be stopped so that the sapinit can stop.
I created both scripts as following and added them via insserv.
Header of /etc/init.d/sapinit
### BEGIN INIT INFO
# Provides: sapinit
# Required-Start: $network $syslog $remote_fs $time
# X-UnitedLinux-Should-Start:
# Required-Stop:
# X-Stop-After: $sapcontrol
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Start the sapstartsrv
# Description: Start the startsapsrv
### END INIT INFO
Header of /etc/init.d/sapcontrol
### BEGIN INIT INFO
# Provides: sapcontrol
# Required-Start: $sapinit
# Required-Stop: $network $syslog $remote_fs $time $sapinit
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start and Stop SAP System as system changed
# Short-Description: start and stop SAP
### END INIT INFO
For this LSB service i defined Required-Stop and Required-Start for correct order, but the system doesnt care.
On Startup the service sapcontrol is started first and needs about 25sec so after 20 sec the sapinit service is started and finished after 2 sec. So the sapinit is finished first, but this is not the purpose i need to start the sapcontrol after the sapinit is completley finished.
Screenshot: systemctl status sapinit
Screenshot: systemctl status sapcontrol
Same for the stop order, when i reboot or shutdown the system the sapinit is stopped nearly first and the sapcontrol is stopped anywhere, but i need to stop the sapcontrol bevore the sapinit.
sapinit stopped: + Wed Aug 1 06:56:08 UTC 2018
sapcontrol stopped: + Wed Aug 1 06:56:28 UTC 2018
Screenshot: shuting down the system
Thanks for your time and help.
1
From user novice: Have you tried changing
– fixer1234 – 2019-01-03T22:37:41.797$sapinit
tosapinit
in the /etc/init.d/sapcontrol? According to this page,$
in the headers indicates a virtual facility name.The poster seems not to want to tell the community. I guess that was the problem. – U. Windl – 2019-04-29T09:17:03.227
I tried changine
$sapinit
tosapinit
, but still didnt work. I was kinda bussy. @U.Windl – ahdgfd – 2019-05-23T07:28:20.553As SLES12 uses systemd, LSB scripts are actually wrapped in systemd units. You could try to override an "After=" condition (using
systemctl edit ...
). – U. Windl – 2019-05-23T09:29:47.410