Have the open and close functions execute the eject command, but *also* wait until the drive is ready before handing off control to someone else.