The command to eject a disc from the command line is:
eject
You can optionally also umount it first:
umount /dev/cdrom
And then eject it manually, the thing is it has to be umounted before you can 'unlock' the drawer. eject does that all in full swoop, but that's the only thing I know of that does.
You have to make sure that nothing is accessing the drive at the time, and that no one in is the mounted directory. You can usually do that pretty easy on a single user system, but if you've got multiple people, drop back to init 1 and go from there:
telinit 1
And then run:
eject
As root of course.
Cool