LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lockup of CD Rom/DVD Rom Device by shell process (https://www.linuxquestions.org/questions/linux-newbie-8/lockup-of-cd-rom-dvd-rom-device-by-shell-process-656305/)

jiju.jacob 07-17-2008 02:06 AM

Lockup of CD Rom/DVD Rom Device by shell process
 
Hi,
I am writing a multi-cd spanning installer for a particular software in Linux (Redhat 4 or greater / Suse )

My Program is in Java. A Shell Script is used to fork the java process. I found out that when the Installer tries to go to the next disc when prompted so, by the installer, the eject command or the umount command is not able to eject / unmount the CD which is already there in the drive.

The eject / umount reports that the device is busy.

Now I tried to find out the process which is accessing the CD-ROM device and the output of command
fuser -m /cdrom0

gives me the PID of the shell process which was used to launch this Java process.

Please note that the Java Process has a separate PID. Also please note as soon as the user launches the shell command for the installer, I copy the files to the temporary directory and then cd to the temporary dir location and then fork the java process from there.

How can i solve this problem ? How can i make the mount of the second and subsequent CD Drives work without this issue ?

Thanks in advance,
Jiju Jacob

TB0ne 07-17-2008 08:38 AM

Quote:

Originally Posted by jiju.jacob (Post 3217300)
Hi,
I am writing a multi-cd spanning installer for a particular software in Linux (Redhat 4 or greater / Suse )

The eject / umount reports that the device is busy.

Now I tried to find out the process which is accessing the CD-ROM device and the output of command
fuser -m /cdrom0

gives me the PID of the shell process which was used to launch this Java process.


Your program is using file(s) on the CDROM, which is mounted. Once that program is loaded, it needs to reference that file, so an attempted dismount will fail, since things are using some file(s) on the CD. You can:

- Copy whatever file(s) the installer uses to a temp directory on the hard drive first, then perform the install
- Have a shell script as part of your installer, that will copy all the CD's to a temp directory on the hard drive, then install from there.
- Do it from a single DVD, and skip CDROM's.
- Send your software out on 8GB thumb drives. :)

resetreset 07-19-2008 02:54 AM

does your java program have files open on the CD when you try to eject? really, its the only thing it could be.


All times are GMT -5. The time now is 09:16 PM.