How to adjust startup packages in centos7..?

Hi all,

I want to adjust startup packages or change boot sequence of packages like firstly i want to move httpd and after that mariadb and something else when centos is booting…??

on number 1 i want to boot httpd and number 2 mariadb…

If anyone know please let me know…??

But why you want to change the order of startup packages? any specific reason?

If you want to change the system statup packages order, you can do it under /etc/rcX.d directory, here X will be your run level.

Under this directory, you will see tons of files starting with Sxx or Kxx. Where S are traced during startup while the K are parsed for shutdown. And here xx indicates the order.

Be careful, these orders are set for a reason and I warn you to don’t play with them unless you know what you are doing.

Hi,

Actually I got the same question in interview so from that day I am curious to know how to so this so in will try this in my virtual machine if something goes wrong won’t effect my machine…

Thank you so much…!!!

@chetankapoor321

Hi by using the “mv” command you can rename the link. For instance, if you want to change S15XXXXX2 to load just before S10XXXXX1

#mv S15exampleproc2 S09exampleproc2

use the above command to rename the link.

and also you can use chkconfig to set the priority for the service

#chkconfig: 35 60 10

The above line is added to the init script will instruct chkconfig to add the service to the runlevels 3 and 5, with a start position of 60 and a kill position of 10.

but while changing the order of this positions you should be careful, bad start order can cause the system to become unstable or unable to load the operating system.