ivman would not start if no CD drive

Bug #215656 reported by Bruno
2
Affects Status Importance Assigned to Milestone
ivman (Ubuntu)
Fix Released
Medium
Pascal De Vuyst

Bug Description

Binary package hint: ivman

ivman would not start if there is no CD drive in the machine. I am using gutsy (Ubuntu 7.10)

# dpkg -s ivman
Package: ivman
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 284
Maintainer: Ubuntu MOTU Developers <email address hidden>
Architecture: i386
Version: 0.6.14-2ubuntu1
(...)

# ivman
manager.c:1387 (do_startup_configure) Directory /etc/ivman/ will be used for configuration files.
/bin/sh: /proc/sys/dev/cdrom/lock: No such file or directory

# ls /proc/sys/dev
ath mac_hid parport rtc scsi wifi0

The solution is simple, add code to check the presence of CD drive before trying to use it (borrowed from debian package)

Index: ivman-0.6.14/src/manager.c
===================================================================
--- ivman-0.6.14.orig/src/manager.c 2007-05-28 10:30:10.000000000 +0200
+++ ivman-0.6.14/src/manager.c 2007-05-28 10:31:29.000000000 +0200
@@ -1411,7 +1411,9 @@
     }

     // Permanently unlock CD / DVD drive
- if ( geteuid() == 0 )
+ // Silently ignore not existing CD / DVD drive
+ struct stat statistic;
+ if ( geteuid() == 0 && stat("/proc/sys/dev/cdrom/lock",&statistic) == 0 )
         ivm_run_command( "echo 0 > /proc/sys/dev/cdrom/lock", NULL, FALSE );

Revision history for this message
Patrick Kilgore (patrick-kilgore) wrote : Re: ivman would not start if no cdrom

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

* Is this reproducible?
* If so, what specific steps should we take to recreate this bug?

This will help us to find and resolve the problem.

Changed in ivman:
status: New → Incomplete
Revision history for this message
Bruno (blfc) wrote :

Hello there

* The bug is reproducible
* To reproduce the bug, start ivman as root on a machine without CDROM or DVDROM drive (phisically detach it if necessary prior testing)

In case it matters my machine is a thinclient(*) and it doesn't have a CD or DVD drive.

Cheers
!3runo

(*) PCENGINES ALIX1C Geode LX 500MHz, 256MB RAM, mini-itx board

description: updated
Revision history for this message
Patrick Kilgore (patrick-kilgore) wrote :

Seems like enough information for a developer to get to work. Thanks for the bug report.

Changed in ivman:
status: Incomplete → Confirmed
Changed in ivman:
importance: Undecided → Medium
Changed in ivman:
status: Confirmed → Triaged
Revision history for this message
Pascal De Vuyst (pascal-devuyst) wrote :

Fixed since hardy:

ivman (0.6.14-3) unstable; urgency=low

   * fix for non-existant-cdrom (Closes: #425887)
     - Thanks Simon Effenberg

 -- Mike O'Connor <email address hidden> Wed, 14 Nov 2007 06:11:44 -0500

Changed in ivman:
assignee: nobody → pascal-devuyst
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.