Wednesday, May 29, 2013

chkconfig priorities

I recently had a problem on a CentOS-6 machine where my dhcp server did not start at boot because it was serving a virtual network interface which did not yet exist.

The best solution to this problem would be for the dhcp server to start up and wait for the network interface to come up. Many other network tools do this successfully so I don't know why dhcpd should be different. That problem is however too big for me to fix on my server so I need a more simple approach.

To solve this, I would like to adjust my dhcp server to start after the virtual network interface service. CentOS-6 uses the (old) RedHat style init scripts (with some LSB configuration too). RedHat like to proclaim that they use upstarts now but all the upstarts do is make a call to the /etc/rc.d/rc script, just like init used to do.

So, the problem is still based around the System V style scripts which have magic comments which define when to start & stop the scripts.

This is the relevant parts of the header for the dhcp server (/etc/rc.d/init.d/dhcpd):
### BEGIN INIT INFO
# Provides: dhcpd
# Default-Start:
# Default-Stop:
# Should-Start: portreserve
# Required-Start: $network
# Required-Stop:
# Short-Description: Start and stop the DHCP server
# Description: dhcpd provides the Dynamic Host Configuration Protocol (DHCP)
#              server.
### END INIT INFO
#
# The fields below are left around for legacy tools (will remove later).
#
# chkconfig: - 65 35


Despite the comments about being legacy, when installed using chkconfig, the priorities used are indeed Start 65, Kill 35. We can confirm this with a simple ls
ls /etc/rc.d/rc?.d/*dhcpd

The virtual network is also controlled by an init script with a more modest header (/etc/rc.d/init.d/vand):
# chkconfig: 2345 95 05
# description: Virtual Area Network Deamon


Not surprisingly, this will Start at 95 and Kill at 05.

The first idea I had was to modify the dhcpd init scrip directly. Unfortunately this script is not marked as config file (in the rpm) so when a new version comes out, my changes will be lost. I need something better than that.

It is not immediately obvious but chkconfig does have the ability to alter the priorities. This is called override (but not to be confused with the command line parameter --override).


I was unable to find and documentation on the override but I did work out that his minimal config file was all that was needed:


/etc/chkconfig.d/dhcp:
### BEGIN INIT INFO
# Required-Start: vand
### END INIT INFO

When chkconfig reads the headers from the dhpcd init script, it will also read this file (because it has the same basename) and override the values from the init script.

All that is needed is to apply the settings with:
chkconfig dhcpd on

Some information about LSB init scripts can be found here http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html

The final job is to make puppet aware of my changes. Perhaps in my next post.

40 comments:

  1. Replies
    1. Which is better but COC Mod APK or Gbwhatsapp? Can you please tell me how to download them as well?

      Delete
  2. The information you shared is very helpful to us. fleeing the complex

    ReplyDelete
  3. Visit neighborhood reston dental center specialist Dr. Ali Miami, VA for family and corrective dentistry. Offering dental inserts, porcelain facade, tooth cleanings, and more.

    ReplyDelete
  4. How to enable or disable service on boot with chkconfig

    hotstar app

    ReplyDelete
  5. The source https://gbwhatsapp.net/gio-whatsapp-apk/ is offering excellent whatsapp features, safe, anti ban and privacy protected features for android and iphone users.

    ReplyDelete
  6. Obrigado por compartilhar isso, muito interessante. Eu recomendo que você visite este site para encontrar jogos de cassino gratis.

    ReplyDelete
  7. I have also encountered such a case and fortunately the WAGBPro team has supported me

    ReplyDelete
  8. Thanks a lot for sharing about these chkconfig priorities. I am so much happy to read. Kinemaster Diamond

    ReplyDelete
  9. Nice article. Thanks for the information .

    ReplyDelete
  10. Enjoyed reading the article above , really explains everything in detail, the article is very interesting and effective. Thank you and good luck in the upcoming articles Netboom apk mod

    ReplyDelete
  11. I am very impressed with your post, thanks for sharing. Would love to see more stuff like this in future. Also download DLS 2022 Mod Apk.

    ReplyDelete
  12. This is excellent information like we have in different sites Aero Whatsapp APK for android and iphone.

    ReplyDelete
  13. Modified versions of whatsapp are also available such as GB Whatsapp, YO Whatsapp, etc. They provide some many extra features for regular whatsapp user.


    ReplyDelete
  14. I’ve compiled a top-rated list of some of the most reliable jigsaws after hours of research and testing almost 50 tools at once. Adding to that, I’ve also considered the positive customer feedback and expert opinions to make things as lenient as possible.



    ReplyDelete
  15. It's very interesting to observe how audio-based social media become more and more popular, maybe one day they will even replace text social media! Thank you for sharing interesting information vipbox

    ReplyDelete
  16. No need to worry. I am going to show you some great paintball masks that will definitely protect your face while still provide good visibility and ventilation, and they won’t break the bank.

    ReplyDelete
  17. Very interesting post you have crafted hear. I am blessed to have come across this resolutions post. Thanks.
    igoal คาสิโนมือถือ

    ReplyDelete
  18. Found your post interesting to read. I cant wait to see your post soon. Good Luck for the upcoming update.This article is really very interesting and effective. Regards Whatsapp Aero Apk

    ReplyDelete
  19. very interesting information to share, thank you for sharing useful information, download free fonts with a huge font store for you to choose, press hindi font free download right away

    ReplyDelete
  20. تحميل لايكي 2022 هو تطبيق وسائط اجتماعية يسمح للأشخاص بمشاركة اهتماماتهم مع الآخرين. يحتوي على أربع ميزات رئيسية: 1) القدرة على رؤية ما يهتم به المستخدمون الآخرون ، 2) مربع نص لكتابة موضوع اهتمامك ، 3) خيار لمتابعة المستخدمين الآخرين الذين يشاركونك اهتماماتك ، و 4) القدرة لإعداد ملفات التعريف الشخصية. يمكن تحميل تطبيق لايكي على كل من أجهزة للاندرويد و الأيفون.

    ReplyDelete
  21. The mod apk for the famous game Candy Crush Soda Saga is a popular choice for Android users. The mod contains unlimited lives and increased gold bar count to make the game more intense.


    ReplyDelete
  22. One day, Sensei accidentally confronted the Shogun soldiers who were trying to kidnap the Prince. He fought with them and won. The shogun was very angry. He immediately recruited ninja and trained them to create an overthrow.

    ReplyDelete
  23. This comment has been removed by the author.

    ReplyDelete
  24. How to use InstaSave to download Instagram photos and videos? · First of all, visit your Instagram app on your device or open it on browser.

    ReplyDelete
  25. As I watched this article, I kept talking about it constantly. I have a clear sense of this. Thank you for sharing. 토토사이트

    ReplyDelete
  26. I am interested in this area if you are a great site but know some community forums. I think it should be a good opportunity to get feedback from others who are experienced. 파워볼분석

    ReplyDelete
  27. This is good news for everyone. i think you will like and fm whatsapp download to use to communicate with people

    ReplyDelete
  28. “We do pregame dedications before every home game,” Ricedorff said. “We honor moms, dads, teachers, and we always have done one for first responders. Now, it’s at a whole new level. It’s a good event for the recognition the first responders deserve.”

    ReplyDelete
  29. Instasave online is Instagram photos, videos and albums downloader. You can download and save your favourite Instagram videos and photosInsta DP Downloader

    ReplyDelete
  30. I find your website to be highly informative and useful, with a great collection of resources. Thank you for sharing this nice post, which includes plenty of valuable information. I thoroughly enjoyed reading it.Fm Whatsapp

    ReplyDelete
  31. Thank You for sharing such a nice post. make sure to checkout Sword Game its absolute fun to play

    ReplyDelete
  32. There is an extraordinary benefit to involving MEAN stack for engineers. Since MEAN stack observes the rules of full stack web advancement, designers approach both front and back-end improvement abilities for your site. The four advancements associated with MEAN stack are MongoDB, Express.js, AngularJS, and Node.js. The upside of these four advances is that they all utilization the JavaScript programming language. This consistency makes advancement more straightforward and the normal web engineer compensation is lower than the general web designer pay of 4 separate engineers (really look at the pay rates examination underneath)>> Mobilunity

    ReplyDelete
  33. http://www.dailymagazine.news/new-zealand-222-3-at-stumps-on-1st-day-1st-test-vs-pakistan-nid-1392957.html

    ReplyDelete

  34. Download the TopFollow APK, but be aware that getting APK files from unauthorized sources might put your device
    and personal data at risk for security breaches. Additionally, it can be against social media networks' terms of
    service to use third-party programs to get followers. top follow

    ReplyDelete
  35. The "chkconfig priorities" troubleshooting on CentOS-6 reflects a common challenge with DHCP servers and virtual interfaces. This informative insight emphasizes the importance of configuring services to adapt to dynamic network environments. FM Whatsapp Download

    ReplyDelete
  36. Experience WhatsApp like never before with MBWhatsKing. Download whatsapp an and stay updated with the newest features and security enhancements effortlessly.

    ReplyDelete