Re: How to open a device for exclusive access?

2007-07-16 Thread Dave Johnson
Ben Scott writes:
> On 7/15/07, Steven W. Orr <[EMAIL PROTECTED]> wrote:
> > ... my particular problem would be
> > solved if the char device I was trying to open would only honor O_EXCL.
> 
>   My C is somewhat rusty, but doesn't O_EXCL just prevent one from
> creating/opening the file if it already exists?

For regular files yes, but char and block drivers can do whatever they
want with the open flags.  Some drivers use O_EXCL for exclusive
access to a device.

-- 
Dave

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread Michael ODonnell


> My C is somewhat rusty, but doesn't O_EXCL just prevent one
> from creating/opening the file if it already exists?

That's the generally accepted meaning of that flag when passed to open()
but only when used along with O_CREAT and then only with "normal" files
and even then, not always.  And you can't use open() for creating device
nodes (use mknod() for that) and you probably don't want to have to be
doing that in any case...

I just looked at the kernel sources and, as somebody already mentioned,
it appears that O_EXCL is handled above the driver level in the fs code
for block devices in completely general fashion.  It turns out that the
open() flags (including O_EXCL) are made available all the way down to
the driver level but a quick scan of the driver sources indicates that
hardly any of them pay attention to it.

The /var/lock trick is not ideal but it's known technology in common
use with no decent alternatives currently available, AFAIK.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread Bill McGonigle


On Jul 15, 2007, at 16:35, Steven W. Orr wrote:


 my particular problem would be
solved if the char device I was trying to open would only honor O_EXCL


It's a close-source character device?

-Bill

-
Bill McGonigle, Owner   Work: 603.448.4440
BFC Computing, LLC  Home: 603.448.1668
[EMAIL PROTECTED]   Cell: 603.252.2606
http://www.bfccomputing.com/Page: 603.442.1833
Blog: http://blog.bfccomputing.com/
VCard: http://bfccomputing.com/vcard/bill.vcf



smime.p7s
Description: S/MIME cryptographic signature
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: CentOS5 mediacheck failing

2007-07-16 Thread Bill McGonigle

On Jul 15, 2007, at 15:08, Ted Roche wrote:


Sorry; I was unclear. I tested both disks on two other machines and
mediacheck passed with flying colors.


I actually don't know - does the media check just verify that it 'can  
read' all sectors, or does it actually checksum them?


I seem to recall at one time I've seen disks that would pass an  
installer's self-check but turned out to fail an md5sum.  I imagine  
this was 4-ish years ago, and I'm not positive on the distro, so none  
of it may apply.


Ben's theory about dye reflectivity incompatibility seems much more  
likely, especially given lowest-bidder components.


-Bill

-
Bill McGonigle, Owner   Work: 603.448.4440
BFC Computing, LLC  Home: 603.448.1668
[EMAIL PROTECTED]   Cell: 603.252.2606
http://www.bfccomputing.com/Page: 603.442.1833
Blog: http://blog.bfccomputing.com/
VCard: http://bfccomputing.com/vcard/bill.vcf



smime.p7s
Description: S/MIME cryptographic signature
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread Steven W. Orr
On Monday, Jul 16th 2007 at 09:53 -0400, quoth Bill McGonigle:

=>
=>On Jul 15, 2007, at 16:35, Steven W. Orr wrote:
=>
=>>  my particular problem would be
=>> solved if the char device I was trying to open would only honor O_EXCL
=>
=>It's a close-source character device?

In fact, the card is proprietary but the driver is open source.

=>
=>-Bill
=>
=>-
=>Bill McGonigle, Owner   Work: 603.448.4440
=>BFC Computing, LLC  Home: 603.448.1668
=>[EMAIL PROTECTED]   Cell: 603.252.2606
=>http://www.bfccomputing.com/Page: 603.442.1833
=>Blog: http://blog.bfccomputing.com/
=>VCard: http://bfccomputing.com/vcard/bill.vcf
=>
=>

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: CentOS5 mediacheck failing

2007-07-16 Thread Lloyd Kvam
On Sun, 2007-07-15 at 14:19 -0400, Ted Roche wrote:
> Trying to install CentOS5 from CD on a new server, Dell SC430, Pentium-D
> 2.8 GHz, 1 Gb RAM, 2-250 Gb SATA drives. I had previously installed FC7
> from the LiveCD and run it though some basic functionality tests, SMART
> drive long tests, etc. Everything appeared to work fine.
> 
> Booting the CentOS5 CD #1 (no DVD drive), I ran the mediacheck, since I
> hadn't tried this set of disks before. Test zipped right through 1%, 2,
> 3, 4,... until about 91% then it got really slow. The CD would stop
> spinning, and just start fitfully every minute or two, and finally
> report FAILED. Testing on two other machines, the same CD reported PASS.
>  Same problem with CD2, fail on this machine, worked on two others.
> 
> A similar thread running on BLU suggests the newest Knoppix use the new
> libata drive and might have trouble with 'legacy' ATAPI drives.
> 
> I've read the CentOS release notes and attempted to Google for clues.
> There's nothing in the installation logs to indicate an error condition.
> 
> Can anyone suggest what to look at next?

Does the centos install support network installations?  When dealing
with computers that lack a DVD drive, I usually use the network install
and refer back to my laptop.  Two useful hints:
use the IP address to reference the source computer 
(http://192.168.0.10/fc7)
mount -o loop fc7-dvd.iso /var/www/html/fc7

If you only have CD.iso images, I assume you can mount them in a
directory, but might need some documentation to get the proper names to
identify the individual CD's, though the error messages might provide a
good clue.

-- 
Lloyd Kvam
Venix Corp

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: CentOS5 mediacheck failing

2007-07-16 Thread Shawn K. O'Shea
> Does the centos install support network installations?  When dealing
> with computers that lack a DVD drive, I usually use the network install
> and refer back to my laptop.  Two useful hints:
> use the IP address to reference the source computer 
> (http://192.168.0.10/fc7)
> mount -o loop fc7-dvd.iso /var/www/html/fc7

Yes, HTTP, FTP and NFS.
http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-steps-network-installs-x86.html

>
> If you only have CD.iso images, I assume you can mount them in a
> directory, but might need some documentation to get the proper names to
> identify the individual CD's, though the error messages might provide a
> good clue.

You're actually supposed to be able to install just by pointing at an
ISO directory, but I've never tried that. The page I linked above says
to mount them as disk1/, disk2, etc.

-Shawn
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: CentOS5 mediacheck failing

2007-07-16 Thread Shawn K. O'Shea
>
> I've read the CentOS release notes and attempted to Google for clues.
> There's nothing in the installation logs to indicate an error condition.
>
> Can anyone suggest what to look at next?

This CentOS 4.3 bug reports the same kind of behavior. It states that
booting with "linux ide=nodma" may help it be happier.
http://bugs.centos.org/view.php?id=1405

-Shawn
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread John Abreau

On Sun, July 15, 2007 1:12 pm, Ben Scott said:

>   I've often wondered why, after 30+ years of *nix, there's still no
> good way to handle locking/contention in the filesystem.  Linux, KDE,
> GNOME, etc., have shown that the *nix community is willing to jettison
> "Unix tradition" when there's an obvious gain to be had.  But it seems
> like file(ish) locking is one of the holdouts.
>

File locking is pretty basic stuff. Breaking with tradition on it would
mean a program won't work on BSD, Solaris, or other Unices. You'd need
a truly gigantic gain to offset that loss, and you'd still be at risk
if other programs that rely on traditional locking try to access the
resources you've locked in a Linux-only manner.

-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
PROTECTED]
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread John Abreau

On Sat, July 14, 2007 1:15 pm, Bill Ricker said:

> right -- you can auto-cleanup old lockfiles if contents are pid of the
> creating process and /proc/$pid doesn't exist when server restarts.
>
> Only if some OTHER process is holding that PID after a reboot or such
> is a stale lockfile a problem for manual intervention. And in that
> case, if lockfile is older than UPTIME, can't be yours, poof

You can always look up the commandline of the PID to see if it's a
different process.

-- 
John Abreau / Executive Director, Boston Linux & Unix
IM: [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL PROTECTED] / [EMAIL 
PROTECTED]
Email [EMAIL PROTECTED] / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: CentOS5 mediacheck failing

2007-07-16 Thread Ted Roche
Ben Scott wrote:
> On 7/15/07, Ted Roche <[EMAIL PROTECTED]> wrote:
> 
>   Check the kernel log (it's on one of the Virtual Consoles,
> [CTRL]+[ALT]+[F4] maybe?) for indications as to what the kernel thinks
> is going on.

I didn't see anything obvious, but will try again and report more
detailed results.

>   While it could be software (something with how the kernel is
> interacting with the ATA controller and CD drive on that computer), it
> could also be that the disc is marginal, so that particular drive
> can't quite read it, but others are able to.  ("Newer" drives aren't
> always better.  Sometimes engineering advances are used to reduce
> overcapacity right down to the edge -- which lowers costs but makes
> things less robust.)

You mean "they just don't make things like they used to?" Yeah.
> 
>   Burn another CD, preferrably with a different burner drive and with
> a different brand of media.  Try the mediacheck of that disc on the
> problem hardware.
> 
>   Try removing the drive from the problem computer and putting it in
> one of the other computers that worked.  See if the mediacheck passes
> then.
> 
>   Try taking a drive that works and putting it in the computer that's
> giving you trouble.  See if the mediacheck passes then.
> 

All good steps to follow. I'll give the software suggestion a try first
since it doesn't involve having to mess with hardware, and see if the
"ide=nodma" switch makes a difference...

-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread Ben Scott
On 7/16/07, John Abreau <[EMAIL PROTECTED]> wrote:
>>   I've often wondered why, after 30+ years of *nix, there's still no
>> good way to handle locking/contention in the filesystem.
>
>
> File locking is pretty basic stuff. Breaking with tradition on it would
> mean a program won't work on BSD, Solaris, or other Unices.

  Bah.  :)  Same excuse was used against X DRI, decent drag-and-drop,
dynamic device nodes, enhanced filesystems, etc., etc.  One of the big
ways Linux succeeds is by advancing the state-of-the-art in *nix while
everyone else is busy worshiping at the altar of backwards
compatibility.  This has succeeded so well that almost every other x86
*nix OS has since implemented some kind of Linux compatibility plan.
Linux did so well at ignored the standard that it has become the
standard for many.  Change always brings some discomfort, but the
alternative is stagnation.

> You'd need a truly gigantic gain to offset that loss ...

  Decent file locking would seem to be a rather nice gain in my book.
You're entitled to disagree.  :)

> ... and you'd still be at risk if other programs that rely on traditional 
> locking try
> to access the resources you've locked in a Linux-only manner.

  One of the nice things about having decent file locking in the OS is
that programming mistakes don't lead to locking failures and obscure
data corruption down the road, they lead to straight-forward error
messages when the file is accessed.

  Kinda like memory protection.  We don't just assume everything will
behave itself; we use the memory manager to keep programs from
stepping on each other (even accidentally).  IMO, it seems reasonable
to expect the same of file locking.

-- Ben
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: How to open a device for exclusive access?

2007-07-16 Thread Kevin D. Clark

Steven W. Orr writes:

> In fact, the card is proprietary but the driver is open source.

So, at this point the "best" solution seems to be obvious:  just
modify the driver to respect O_EXCL.  Surely the original authors of
the driver would welcome this enhancement.

--kevin
-- 
GnuPG ID: B280F24E  God, I loved that Pontiac.
alumni.unh.edu!kdc   -- Tom Waits

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


[GNHLUG] NHRuby.org Meeting TOMORROW, July 17: Live Coding Session

2007-07-16 Thread Scott Garman
Sorry about the late notice - I've been traveling since last Thursday.
So I'll keep this short and to the point.

WHEN: Tuesday, July 17, 2007. 7-9 PM.
WHERE: RMC Research Offices, Portsmouth, NH

WHAT: This month's meeting will consist of a live coding session where
group members Scott Garman and Nick Plante will develop from scratch a
Rails-based web application suggested by member Brian Buckley.

This application will be used to allow members to submit desired meeting
topics for the NH Ruby User Group, allowing registered members to vote
on topics.

This will be a very interactive, beginner-friendly session where the
audience is encouraged to ask questions and help guide the development
of this application.

Also, a copy of Ajax on Rails, by Scott Raymond, will be given away,
thanks to O'Reilly's user group program.

If this presentation proves to be successful, we will consider
continuing to work on this application for the August meeting as well.

For a map and driving directions, see our wiki site:

http://wiki.nhruby.org/index.php/Upcoming_meetings

Regards,

Scott

-- 
Scott Garman
sgarman at zenlinux dot com


___
gnhlug-announce mailing list
[EMAIL PROTECTED]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-announce/
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/