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.

  • From user novice: Have you tried changing $sapinit to sapinit in the /etc/init.d/sapcontrol? According to this page, $ in the headers indicates a virtual facility name. – fixer1234 Jan 3 at 22:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.