I need to kill some services when shutdown/reboot my Linux server, but I am not sure how Reboot command works.
To my understanding, /etc/rc0.d/ scripts will be invoked when system is shutdown, while the /etc/rc6.d/ scripts will be invoked when system is rebooted.
But according to this link: https://linux.die.net/man/8/reboot, reboot command also call shutdown command except when running on level 0 and 6, so does this mean /etc/rc0.d/ scripts are also invoked when reboot command is run ?
Do I only need to put the service kill script into /etc/rc0.d/ and /etc/rc1.d/ ? Or does it also need to be in /etc/rc6.d/ to make sure the service is stopped when reboot ?
Edit: Add my server configuration. Currently running Redhat, varying from 6.x to 7.2.