Report forwarded to debian-bugs-dist@lists.debian.org, Miquel van Smoorenburg <miquels@cistron.nl>:
Bug#95326; Package liblockfile1.   debian-bugs-dist@lists.debian.orgMiquel van Smoorenburg  Subject: Bug#95326: UUCP-style device locking Reply-To: Ole Aamot , 95326@bugs.debian.org Resent-From: Ole Aamot Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Miquel van Smoorenburg Resent-Date: Thu, 26 Apr 2001 14:04:12 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 95326 X-Debian-PR-Package: liblockfile1 X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by bugs@bugs.debian.org id=B.98829099916483 (code B ref -1); Thu, 26 Apr 2001 14:04:12 GMT Date: Thu, 26 Apr 2001 15:16:34 +0200 From: Ole Aamot To: submit@bugs.debian.org 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 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   Acknowledgement sent to Ole Aamot <oka@student.matnat.uio.no>:
New Bug report received and forwarded. Copy sent to Miquel van Smoorenburg <miquels@cistron.nl>.   -t  From: owner@bugs.debian.org (Debian Bug Tracking System) To: Ole Aamot Subject: Bug#95326: Acknowledgement (UUCP-style device locking) Message-ID: In-Reply-To: References: X-Debian-PR-Message: ack 95326 Thank you for the problem report you have sent regarding Debian. This is an automatically generated reply, to let you know your message has been received. It is being forwarded to the developers mailing list for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Miquel van Smoorenburg If you wish to submit further information on your problem, please send it to 95326@bugs.debian.org (and *not* to bugs@bugs.debian.org). Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Darren Benham (administrator, Debian Bugs database)   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   Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#95326; Package liblockfile1.   debian-bugs-dist@lists.debian.org  Subject: Bug#95326: UUCP-style device locking Reply-To: Miquel van Smoorenburg , 95326@bugs.debian.org Resent-From: Miquel van Smoorenburg Resent-To: debian-bugs-dist@lists.debian.org Resent-Date: Thu, 26 Apr 2001 15:33:55 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 95326 X-Debian-PR-Package: liblockfile1 X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by 95326-bugs@bugs.debian.org id=B95326.9882985297066 (code B ref 95326); Thu, 26 Apr 2001 15:33:55 GMT Date: Thu, 26 Apr 2001 17:22:03 +0200 From: Miquel van Smoorenburg To: Ole Aamot Cc: 95326@bugs.debian.org Message-ID: <20010426172203.A19800@cistron.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from oka@student.matnat.uio.no on Thu, Apr 19, 2001 at 08:06:23PM +0200 X-NCC-RegID: nl.cistron Delivered-To: 95326@bugs.debian.org According to Ole Aamot: > 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? Could be done pretty easily. A new flag for lockfile_create, L_HDBPID or L_FMTHDB should be added so that the pidfile is written as %10d\n instead of %d\n, but that would be all. Note that lockfile_create doesn't lock a file or a device, all it does is that it creates a lockfile. So you would have to convert /dev/cua0 to /var/lock/LCK..cua0 in the program before calling lockfile_create. Perhaps I should add a function int lockfile_name(char *device, char *out, int outsz, int flags) where flags is L_NAME_MBOX mailbox lock L_NAME_DEV device lock that converts a device name to a lockfile? Mike.   Acknowledgement sent to Miquel van Smoorenburg <miquels@cistron.nl>:
Extra info received and forwarded to list.   -t  From: owner@bugs.debian.org (Debian Bug Tracking System) To: Miquel van Smoorenburg Subject: Bug#95326: Info received (was Bug#95326: UUCP-style device locking) Message-ID: In-Reply-To: <20010426172203.A19800@cistron.nl> References: <20010426172203.A19800@cistron.nl> X-Debian-PR-Message: ack-info-maintonly 95326 Thank you for the additional information you have supplied regarding this problem report. It has been forwarded to the developer(s) and to the developers mailing list to accompany the original report. If you wish to continue to submit further information on your problem, please send it to 95326@bugs.debian.org, as before. Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Darren Benham (administrator, Debian Bugs database)   Received: (at 95326) by bugs.debian.org; 26 Apr 2001 15:22:09 +0000 From miquels@cistron-office.nl Thu Apr 26 10:22:09 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 14snap-0001pv-00; Thu, 26 Apr 2001 10:22:08 -0500 Received: from subspace.cistron-office.nl ([195.64.65.200]) by smtp.cistron-office.nl with esmtp (Exim 3.22 #1 (Debian)) id 14snal-0002mx-00; Thu, 26 Apr 2001 17:22:03 +0200 Received: (from miquels@localhost) by subspace.cistron-office.nl (8.9.3/8.9.3/Debian 8.9.3-6) id RAA20015; Thu, 26 Apr 2001 17:22:03 +0200 Date: Thu, 26 Apr 2001 17:22:03 +0200 From: Miquel van Smoorenburg To: Ole Aamot Cc: 95326@bugs.debian.org Subject: Re: Bug#95326: UUCP-style device locking Message-ID: <20010426172203.A19800@cistron.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from oka@student.matnat.uio.no on Thu, Apr 19, 2001 at 08:06:23PM +0200 X-NCC-RegID: nl.cistron Delivered-To: 95326@bugs.debian.org According to Ole Aamot: > 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? Could be done pretty easily. A new flag for lockfile_create, L_HDBPID or L_FMTHDB should be added so that the pidfile is written as %10d\n instead of %d\n, but that would be all. Note that lockfile_create doesn't lock a file or a device, all it does is that it creates a lockfile. So you would have to convert /dev/cua0 to /var/lock/LCK..cua0 in the program before calling lockfile_create. Perhaps I should add a function int lockfile_name(char *device, char *out, int outsz, int flags) where flags is L_NAME_MBOX mailbox lock L_NAME_DEV device lock that converts a device name to a lockfile? Mike.