LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   CDemu returns error loading shared library libmirage.so.2 (https://www.linuxquestions.org/questions/linux-software-2/cdemu-returns-error-loading-shared-library-libmirage-so-2-a-817679/)

rohedin 07-02-2010 01:40 PM

CDemu returns error loading shared library libmirage.so.2
 
I have downloaded CDemu from http://sourceforge.net/projects/cdemu/ and installed it without errors. However when I go to /usr/local/bin and run ./cdemud it returns the following error,
Quote:

ben@Scottie /usr/local/bin $ ./cdemud
./cdemud: error while loading shared libraries: libmirage.so.2: cannot open shared object file: No such file or directory
I find this confusing as I have installed libmirage - http://sourceforge.net/projects/cdem...r.bz2/download - and I have found libmirage.so.2 in /usr/local/lib.
Am I doing anything wrong? Does anyone know how I can fix it?
Thanx in advance for any help on this problem! :)

knudfl 07-03-2010 04:18 AM

Not very unusual : The executable 'cdemud'
may be hard coded to look in /usr/lib/ only.

Just create a symlink libmirage.so.2 to /usr/lib/

..

rohedin 07-03-2010 01:05 PM

Thanx for the reply :)
I have done what you sugested but it comes up with a new error,
Quote:

Scottie bin # ./cd*
Starting daemon in local mode with following parameters:
- num devices: 1
- ctl device: /dev/vhba_ctl
- audio driver: null
- bus type: system
cdemud: Daemon: failed to request name on system bus!
Daemon initialization failed: Name request on D-BUS failed.
Does anyone know how to fix this?

knudfl 07-04-2010 06:11 AM

Google
.. Daemon initialization failed: Name request on D-BUS failed ..

http://biodegradablegeek.com/2008/07...x-using-cdemu/
> line 250. ( It's a good tutorial. Suggest: Read it all.)

Please try : sudo cdemud

Did you install the required vhba module ?
May be : sudo modprobe vhba
.....

rohedin 07-05-2010 11:42 AM

Found something else :)
 
I actually found an other program, gmount-iso, that works ;)

Yiguro 09-02-2010 01:06 PM

How I compiled CDemu in fedora 13
 
1 Attachment(s)
______________________________

EDIT: I've added info on how to run on session bus, something that I couldn't get to work until now.
______________________________

I've tried this in fedora 13 64 bit, but it should also work for 32 bit. Everything installs to /usr/local, except gCDemu, which is installed to /usr.


Compiling

RUN EVERYTHING AS ROOT
  • libmirage

    Code:

    Dependencies: yum install glib2-devel libsndfile-devel zlib-devel
    Install: ./configure && make && make install

  • vhba

    Code:

    Install: make && make install
  • cdemu-daemon

    Code:

    Dependencies: yum install dbus-devel dbus-glib-devel libao-devel libdaemon-devel

    Install: PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --sysconfdir=/etc && make && make install

    PKG_CONFIG_PATH=/usr/local/lib/pkgconfig tells it to look for libmirage libraries in /usr/local/lib, not /usr/lib. The --sysconfdir=/etc is necessary, because according to the README file:

    Quote:

    ...due to the way autotools are used, /etc gets
    prefixed and therefore config file ends up installed into ${prefix}/etc/. To
    avoid this, you should pass --sysconfdir=/etc to configure, regardless of the
    prefix you are passing to configure.
    If you didn't do this, you would get your second error:

    Code:

    'cdemud: cdemud_daemon_initialize: failed to get name on system bus!
    Daemon initialization failed: Name request on D-BUS failed.'

    Now, issue this commands (extracted from http://debianforum.de/forum/viewtopic.php?f=34&t=102071)

    Code:

    cd /etc/ld.so.conf.d
    create file named usr-local-lib.conf (or whatever name you like) containing:
    Code:

    /usr/local/lib
    and finally, run
    Code:

    ldconfig
    These commands avoid the first error you got:
    Code:

    "./cdemud: error while loading shared libraries: libmirage.so.3: cannot open shared object file: No such file or directory"
    NOTE: (my library is libmirage.so.3 instead of libmirage.so.2 because I'm using a newer version on CDemu). knudfl suggested to add a symbolic link in /usr/bin pointing to /usr/local/lib/ligmirage.so.3. While that works, it's better to do what we've done here.

  • cdemu-client
    Code:

    Dependencies: yum install intltool pygtk2-devel

    Install: ./configure && make && make install

    Add the following to your ~/.bash_profile:

    Code:

    export PYTHONPATH=/usr/local/lib/python2.6/site-packages
    If you didn't do this, you would get another error:
    Code:

    [root@power-sylvia cdemu-client-1.1.0]# cdemu
    Traceback (most recent call last):
    File "/usr/local/bin/cdemu", line 23, in <module>
    import cdemu, cdemu.cdemu
    ImportError: No module named cdemu

  • gcdemu
    Code:

    Install: ./configure --prefix=/usr && make && make install
    The --prefix=/usr thing is because Gnome looks for its panel applets in /usr.
    Now, log out and log in
    Right click on menu, Add to panel... -> gCDEmu Applet (an applet for controlling cdemu devices). Right click on the gcdemu applet. If you check "Use system bus" gCDemu listens for cdemu-daemon on the system bus, otherwise, it listens on the session bus. In the next section "How to start CDemu at boot" there's more information about it.



How to start CDemu at boot:

  • Load vhba module at boot
    Create a file named /etc/sysconfig/modules/vhba.modules containing:

    Code:

    modprobe vhba
    Now, you have to decide whether you want to run cdemu-daemon in system bus (daemonized) or session bus (executed as a regular command in a startup script). CDemu 1.3.0 recommends session bus because it's more secure.

    Procedure for system bus:

    • Add init script
      Create file /etc/rc.d/init.d/cdemud containing the file I've attached (remove the .txt extension)

      Add execute permissions to the file you just created:

      Code:

      chmod ugo+x cdemud
      By the way, the start priority for this script is the lowest possible (99). This is because if its priority is very high, /etc/sysconfig/modules/vhba.modules gets loaded after it (should be before, it's a "race condition"), causing an error at the boot sequence:

      Code:

      Starting CDemud: Failed to start daemon (1).
      If this happens, gCDemu applet will appear greyed out.

      However, with priority 99 everything starts fine:

      Code:

      Starting CDemud: Daemon successfully started.

    • Make the script start at every boot. There are several options:
      • Using Fedora/Red Hat's chkconfig (recommended for Fedora):
        Code:

        chkconfig --add cdemud
      • If you're not using Fedora, it would be a different command (e.g update-rc.d in Debian) and modify script startup # accordingly

      • Manually adding symbolic links to rcX.d. Add SXXcdemud and KXXcdemud symbolic links, where XX is any free number available, in my case I've used 41:

        Code:

        cd /etc/rc.d/init.d
        ln -s cdemud ../rc0.d/K41cdemud
        ln -s cdemud ../rc1.d/K41cdemud
        ln -s cdemud ../rc2.d/S41cdemud
        ln -s cdemud ../rc3.d/S41cdemud
        ln -s cdemud ../rc4.d/S41cdemud
        ln -s cdemud ../rc5.d/S41cdemud
        ln -s cdemud ../rc6.d/K41cdemud


    Procedure for (the recommended) session bus:

    • First, create a file named /etc/udev/rules.d/99-vhba.rules containig:
      Code:

      KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemud"
    • Add "cdemud" group. You can do it from Gnome's GUI or using command line:

      Code:

      # groupadd cdemud
      # usermod -a -G cdemud your_username

    • Finally, add the following to your ~/.bash_profile:
      Code:

      /usr/local/bin/cdemud --bus=session &

If gCDemu appears greyed out, check whether you're using system or session bus, then right click the gcdemu applet and check/unckeck "Use system bus" accordingly. If it's checked it'll use system bus, otherwise, it'll employ session bus.

_________________________________________

If you arrived here finding info for this error:

Code:

[root@fedora standard]# cdemud --bus=session
Starting daemon in local mode with following parameters:
 - num devices: 1
 - ctl device: /dev/vhba_ctl
 - audio driver: null
 - bus type: session

cdemud: Daemon: failed to get session bus!
Daemon initialization failed: Failed to connect to D-BUS bus.

It happens because you are running cdemud session bus as root. You can only run as root when using system bus. Check mrok quote from http://sourceforge.net/tracker/?func...75&atid=603423

Quote:

mrok said:
If you use session bus, you should run the daemon as the user
instead of root. Each user has their own session bus, which is inaccessible
by other users; therefore CDEmu instance ran on session bus as root won't
be accessible by other users...


All times are GMT -5. The time now is 04:01 PM.