CDLibrary - a driver to Dacal CD Library 2 devices

Copyright: 2009 by Florian Boesch
license:GNU GPL3

This Driver allows you to access CD Library 2 devices connected on the USB ports either via http or the filesystem

Copyright (C) 2009 Florian Boesch <pyalot@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


  • plug&play recognizes connected devices
  • list unique device ids
  • open specified slots
  • retract slots


cdlibrary console is a python package installable by any of the following commands: command line:

cd cdlibrary; python setup.py install
easy_install cdlibrary
easy_install http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz

Once you have the package installed (as root) you need to add a daemon script: command line:

sudo su -
wget http://hg.codeflow.org/cdlibrary/archive/tip.tar.gz
tar xzvf tip.tar.gz
cp cdlibrary-*/cdlibd /etc/init.d
update-rc.d -f cdlibd defaults

you can also use the code below as a start script: code:

import sys
from cdlibrary import http, filesystem

daemon = filesystem.daemon
#daemon = http.daemon

if __name__ == '__main__':
    command = sys.argv[1]
    if command == 'start':
    elif command == 'stop':
    elif command ==  'restart':
    elif command == 'debug':


command line:

/etc/init.d/cdlibd start|stop|restart|debug

HTTP interface

File System Interface

  • ls /mnt/cdlibrary --> lists the device IDs as directory listing
  • echo 123 > /mnt/cdlibrary/<device-id> --> opens slot 123
  • echo close > /mnt/cdlibrary/<device-id> --> closes the slot of this device