Received: (at submit) by bugs.debian.org; 26 Apr 2001 13:16:39 +0000 From miquels@cistron-office.nl Thu Apr 26 08:16:39 2001 Return-path: Received: from 10fwd.cistron-office.nl (smtp.cistron-office.nl) [195.64.65.197] (mail) by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 14sldO-0004Hm-00; Thu, 26 Apr 2001 08:16:39 -0500 Received: from subspace.cistron-office.nl ([195.64.65.200]) by smtp.cistron-office.nl with esmtp (Exim 3.22 #1 (Debian)) id 14sldK-0000Ir-00 for ; Thu, 26 Apr 2001 15:16:34 +0200 Received: (from miquels@localhost) by subspace.cistron-office.nl (8.9.3/8.9.3/Debian 8.9.3-6) id PAA15281 for submit@bugs.debian.org; Thu, 26 Apr 2001 15:16:34 +0200 Date: Thu, 26 Apr 2001 15:16:34 +0200 From: Ole Aamot To: submit@bugs.debian.org Subject: UUCP-style device locking Message-ID: Mail-Followup-To: Ole Aamot , submit@bugs.debian.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Received: from pat.uio.no (IDENT:7411@pat.uio.no [129.240.130.16]) by janeway.cistron.net (8.9.3/8.9.3/Debian 8.9.3-6) with ESMTP id UAA04805 for ; Thu, 19 Apr 2001 20:06:30 +0200 Received: from naglfar.ifi.uio.no ([129.240.64.54]) by pat.uio.no with esmtp (Exim 2.12 #7) id 14qIoy-0001bs-00; Thu, 19 Apr 2001 20:06:24 +0200 Received: (from oka@localhost) by naglfar.ifi.uio.no ; Thu, 19 Apr 2001 20:06:23 +0200 (MET DST) X-Mailer: Gnus v5.7/Emacs 20.7 Delivered-To: submit@bugs.debian.org Package: liblockfile1 Severity: wishlist Hi, Thanks for all your great work. As the maintainer, would you support UUCP-style device locking in liblockfile - or must this be implemented (alone) somewhere else? I haven't found a standard library to do it. Examples of non-blocking devices that this might be useful for: - digital cameras - modems - palm pilot cradles The principle is described and encouraged in FHS 2.1 section 5.6: -- 5.6 /var/lock : Lock files Lock files should be stored within the /var/lock directory structure. Device lock files, such as the serial device lock files that were originally found in either /usr/spool/locks or /usr/spool/uucp, must now be stored in /var/lock. The naming convention which must be used is LCK.. followed by the base name of the device file. For example, to lock /dev/cua0 the file LCK..cua0 would be created. The format used for device lock files must be the HDB UUCP lock file format. The HDB format is to store the process identifier (PID) as a ten byte ASCII decimal number, with a trailing newline. For example, if process 1230 holds a lock file, it would contain the eleven characters: space, space, space, space, space, space, one, two, three, zero, and newline. Then, anything wishing to use /dev/cua0 can read the lock file and act accordingly (all locks in /var/lock should be world-readable). -- Thoughts? -- Ole