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.

43 comments:

  1. Replies
    1. Osm! This post is very informative and effective. I got what I was looking for. Here to say thank you. Thanks for sharing FMWhatsapp valuable content.

      Delete
    2. 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. Great, your post is helping me a lot. Thanks for the detailed info on this topic. It’s hard to find nowadays to know about the basics but you did it so much well. I would love to see more about it. Keep sharing and updated. Also share more posts with us. Thank you. FMWhatsapp

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

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

    ReplyDelete
  10. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you. Download GBWhatsApp APK

    ReplyDelete
  11. Thanks for sharing this valuable piece of information. Keep sharing more such awesome articles in the future. Goodbye! Download FMWhatsApp APK

    ReplyDelete
  12. Nice article. Thanks for the information .

    ReplyDelete
  13. 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
  14. Relate with expert java teachers online for java direction or need regulation with study or assignments. Chat with excellent java assignment help during Java programming students normally struggle with all subject’s complexities and review honest write my assignment. Java programming appears an irresistible subject and fragments comprehend the compulsion to address themselves to acquire the subject. For every sort of support with your Java assignment, you are desired to sense our website for descriptions finished by our 24 X 7 online buyer support. java assignment help online

    ReplyDelete
  15. 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
  16. This is excellent information like we have in different sites Aero Whatsapp APK for android and iphone.

    ReplyDelete
  17. يبحث الكثير من الأشخاص المتصلين بالإنترنت عن شركة تصميم تطبيقات أو شركة برمجة تطبيقات لتصميم وبرمجة تطبيقات
    أحدهما فقط ، بحيث يدرك التطبيق أفكار العميل سواء كانت أفكارًا جديدة ومبتكرة أو تم تنفيذها من قبل اندرويد وايفون
    لذا فالشعبية الهائلة للهواتف الذكية والتطبيقات. استثمر العديد من الشركات في أفكار التصميم والبرمجة الأصلية القائمة على تطبيقات الهاتف المحمول. هناك العديد من شركات تصميم تطبيقات الهاتف المحمول ، لكن القليل منها هو الأفضل دون ارتكاب أخطاء. عملية تصميم التطبيق ليست معقدة كما يعتقد البعض ، فقط في حالة التنفيذ. بناء على قواعد وأسس التصميم والبرمجة.
    تعتبر شركة الملتقى افضل شركة تصميم متجر الكتروني
    تصميم متجر الكتروني

    ReplyDelete
  18. 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
  19. 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
  20. 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
  21. 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
  22. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

    Habotao.com
    Information
    Click Here
    Visit Web

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

    ReplyDelete
  24. 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
  25. 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
  26. تحميل لايكي 2022 هو تطبيق وسائط اجتماعية يسمح للأشخاص بمشاركة اهتماماتهم مع الآخرين. يحتوي على أربع ميزات رئيسية: 1) القدرة على رؤية ما يهتم به المستخدمون الآخرون ، 2) مربع نص لكتابة موضوع اهتمامك ، 3) خيار لمتابعة المستخدمين الآخرين الذين يشاركونك اهتماماتك ، و 4) القدرة لإعداد ملفات التعريف الشخصية. يمكن تحميل تطبيق لايكي على كل من أجهزة للاندرويد و الأيفون.

    ReplyDelete
  27. 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
  28. 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
  29. This comment has been removed by the author.

    ReplyDelete
  30. 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
  31. As I watched this article, I kept talking about it constantly. I have a clear sense of this. Thank you for sharing. 토토사이트

    ReplyDelete
  32. 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
  33. The main reason for this success was the change in the way of life of many people due to the global pandemic. However, this did not affect gambling, a large number of fans prefer online games. In this sense, it is safe to say that the conditions for the development of new slot machines were favorable https://rootcasino-rs.com/

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

    ReplyDelete
  35. That is a very good tip especially to those fresh to the blogosphere. Short but very accurate info… Thanks for sharing this one.

    Kindly Visit our Website:- Norton Secure VPN not Working

    ReplyDelete
  36. “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
  37. Instasave online is Instagram photos, videos and albums downloader. You can download and save your favourite Instagram videos and photosInsta DP Downloader

    ReplyDelete
  38. UK49s today teatime results in 2022. Latest 49s and UK teatime results, previous UK49 results and UK 49s teatime result for South Africa.Lunchtime Result Today10insta Downloader

    ReplyDelete