Stop the DVD tray auto-closing in XBMC

I've been suffering from an extremely irritating problem for a while - within XBMC as soon as I eject the DVD drive (by remote control, by pressing the button on the drive, by the button within XBMC, ...) it opens then immediately closes again. This makes it very hard to get disks in and out, although through practice I have got very quick on the draw. It is doubly odd, as if I boot to runlevel 3 (not 5), then the drive stays open with no problems.

Anyway, after a lot of googling, I came across this bug report from Red Hat (I run Arch linux), which in one of the hundreds of problems contained the answer. Simply (as root) add the following to /etc/sysctl.conf

dev.cdrom.autoclose = 0

Reboot (or tell sysctl to reread its config file: "sysctl -p") and all should be good.