Oracle linux 7.9 shutdown too fast prevent K* scripts in /etc/rc0.d to complete normally — oracle-tech

    Forum Stats

  • 3,714,556 Users
  • 2,242,576 Discussions
  • 7,844,931 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Oracle linux 7.9 shutdown too fast prevent K* scripts in /etc/rc0.d to complete normally

Jonau01
Jonau01 Member Posts: 10 Red Ribbon

Oracle linux : 7.9 ; kernel : 4.1.12-124.48.2.el7uek.x86_64

Issue : I have a script to be executed at shutdown and it may take from a few seconds to a few minutes and I do want the script to complete normally. The script is installed in /etc/init.d with chkconfig. It as been tested successfully prior to installed in /etc/init.d . According to the script log , it was triggered by the shutdown but could not complete because the shutdown complete too fast ( less than 18 seconds ) .

Question : how can I configure Oracle linux to wait for K* scripts to complete

Best Answer

  • andreas.dijkman
    andreas.dijkman Member Posts: 46 Bronze Badge
    Accepted Answer

    Use systemd-services and use unit-dependencies. SysV-init is obsolete and shouldn't be used anymore in EL7 and higher.

    Systemd is tracking it's processes and open files of the services it uses. If the script or binary isn't tracked by systemd, it cannot calculate the dependencies of certain actions, like unmounting filesystems and such. As systemd is a heavily parallel system it want's to do stuff, like unmounting filesystems, that aren't in use anymore. So if it's not in use by systemd, it won't wait on it.

    What are you trying to do? Stop an Oracle-database or something else that runs longer than normal?

    Jonau01

Answers

  • andreas.dijkman
    andreas.dijkman Member Posts: 46 Bronze Badge
    Accepted Answer

    Use systemd-services and use unit-dependencies. SysV-init is obsolete and shouldn't be used anymore in EL7 and higher.

    Systemd is tracking it's processes and open files of the services it uses. If the script or binary isn't tracked by systemd, it cannot calculate the dependencies of certain actions, like unmounting filesystems and such. As systemd is a heavily parallel system it want's to do stuff, like unmounting filesystems, that aren't in use anymore. So if it's not in use by systemd, it won't wait on it.

    What are you trying to do? Stop an Oracle-database or something else that runs longer than normal?

    Jonau01
  • Jonau01
    Jonau01 Member Posts: 10 Red Ribbon

    I want to stop several databases and applications.

    systemd-services are completely new to me. I will have to do some research and learn on this subject and eventally perform some tests.

    Thank you for your input.

  • andreas.dijkman
    andreas.dijkman Member Posts: 46 Bronze Badge

    I've run into this problem with Oracle Databases and created some python-scripts and systemd-services for exactly this case. Feel free to use them and/or enhance them: https://github.com/rippiedoos/oracle-systemd-scripts

  • Jonau01
    Jonau01 Member Posts: 10 Red Ribbon

    I just tested startup/shutdown with systemd-services using dbshut and dbstart and Oracle linux did wait for dbshut to complete (withing a default timeout of 1min30 seconds). I will add TimeoutStopSec parameter with a longer elapse time later on.

    I will look into your scripts later on and will have to learn python to understand them.

    Thank you for all your infos

Sign In or Register to comment.