1

I am looking for something that suspends the boot process (before certain services are started). It would prompt the console for user input after which I could use that input and continue booting the machine.

Much like the pass phrase dialog that is presented when there are encrypted drives.

If there is nothing 'off-the-shelf' then I am proficient enough to write c/c++ that takes input from stdin and processes that. How do I go about suspending the boot process? Do I simply place my program in say /etc/rc3.d with an appropriate level in the binary name? Would the boot process simply wait until that process finishes? Any pointers would be appreciated.

I intend to use shared memory to store this user input, so the boot process must be suspended where that is available to me.

Target system is CentOS 6.

1

You have to put a script with the appropriate level in /etc/rc3.d/, as you already wrote.

All the scripts in that directory are run in order of their sequence number, scripts with the same number run in parallel. Only once all scripts of one level have completed running will the scripts with the next higher level be started. So yes, execution will wait for your script to complete. This gives you the opportunity to input whatever data is needed.

One thing you may want to take into account is what happens if the reboot happens when no one is there to input data? Do you want to wait indefinitely, or do you want to continue after some timeout?

  • I realise that someone needs to be present for the machine to boot. It runs services that need the user input. Waiting indefinitely is the desired behaviour. Thanks for the response. – Lieuwe Feb 7 '18 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.