pythonipmitool

python ipmitool reboot issue in Linux


here is the thing, I created a txt file with string used python first, so far, everything is normal. then used ipmitool to reboot, but the txt file is empty when OS boot up.

with open('test.txt','a+') as f:
 f.write('test')

os.system('sudo ipmitool chassis power reset')

I have no idea how this happened, is there any possible reasons may cause this? BTW, if manually execute ipmitool, it's normal too.


Solution

  • add sync command before ipmitool chassis power reset. It will flush buffers to permanent storage.

    sync; ipmitool chassis power reset