> There is also a need for a similar thing on NT and I got soem code to do that. > If I include the code, then there will be a new function in libscg > to lock the drive and I hope that there will be a solution to make the > volmgt hack work with /dev/scg* too.
As I already mentioned earlier I've failed to make it clear in the original post that the patch addresses the systems *without* /dev/scg* (which is more or less whole point about it:-). The VOLMGT code disengages itself in the presense of /dev/scg* (if (ioctl(fd, DKIOCINFO, &ci)==0) takes care of this). But if scg is an option... The only way (we could find) to get /dev/scg* play along with vold gracefully and *reliably* was to kill -STOP <vold's pid> before and kill -CONT <vold's pid> after you run cdrecord (we used to do it with a set-root-uid wrapper script similar to one at the end). However! This was under Solaris 2.6 which is insisting on ejecting the blank media. Point here is that by the time cdrecord was loading the media, vold was -STOP-ed and had no chance to talk to the "V-driver(*)." So that when cdrecord exited and vold was resumed, it (vold) happily detected and mounted the newly burned CD. I.e. it worked simply beautifully under 2.6. Well, as long as you didn't insert already burned CD-RW media and tried to overwrite it, then vold simply dropped dead with SEGV (as far as I remember). Solaris 8 in turn doesn't insist on ejecting blank media and vold has all chances in the world to tell the "V-driver" things it feels like telling before cdrecord starts talking to /dev/scg *behind* the "V-driver's" back... The catch here is that the "V-driver" doesn't appear to be bullet-proof (we've observed unkillable eject processes and even kernel panic) so that you basically don't want to mess with it nor confuse it too much. I can't tell how it (kill -STOP/CONT-ing) would work under Solaris 8 as I didn't want to and never installed scg driver (under Solaris 8)... But what *should* work is to open the tray, put media in but not close the tray, "kill -STOP <vold's pid>," "cdrecord," "kill -CONT <vold's pid>." Alternatively you can execute "eject cdrom" before "kill -STOP <vold's pid>"... Or in other words something similar to the following should always do the trick with /dev/scg*: #!/usr/local/bin/perl -T foreach $i (keys %ENV) { if ($i !~ /^(TZ|USER|LOGNAME|HOME)$/) { delete $ENV{$i}; } } $ENV{'PATH'}="/usr/bin"; $ENV{'IFS'}=" \t\n"; system("/usr/bin/eject","cdrom"); $voldpid=`ps -e | awk '/vold/{print\$1}'`; kill ('STOP',$voldpid); system("/where/ever/it/really/is/cdrecord",@ARGV); kill ('CONT',$voldpid); So try this out, I-wish-I-knew-<[EMAIL PROTECTED]>'s-first-name! Cheers. Andy. (*) kernel part of volume manager mambo-jumbo. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]