So, here’s my case, I have a machine(say M) to be booted using PXE boot and install an OS (say CentOS) in that machine. M will not have any monitors or keyboards attached to it.
PXE boot server is also running from a CentOS machine (say B)
How will I write a program (bash script, Java program) that sits in the machine B and get the status/notification that machine M has successfully finished installing the OS.
Note, that I cannot check manually that the OS has finished the installation. I need to automate that process.
I will be glad if you guys could suggest the best and the efficient way of doing that.
A simple enough way would be to use NFS to access a directory on B from M after installation has completed (depending on the installation method — for kickstart, use a post-install script). Create a file in some directory as a flag that the installation has completed. On machine ‘B’, you can use
inotifyfeatures to detect the completion (eitherinotifywaitfrom a shell script orlibinotifyotherwise).If NFS is barred for some reason, you should be able to use
scporsshfsfairly easily. The most complex part is copying over the generated keys.