[BusyBox 0001433]: [patch] tool for use of flock style locks in shell scripts

bugs at busybox.net bugs at busybox.net
Mon Jul 23 12:34:39 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1433 
====================================================================== 
Reported By:                mirabilos
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1433
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             07-20-2007 05:04 PDT
Last Modified:              07-23-2007 05:34 PDT
====================================================================== 
Summary:                    [patch] tool for use of flock style locks in shell
scripts
Description: 
This tool is used in OpenWrt and also part of FreeWRT,
maybe others use it as well.

====================================================================== 

---------------------------------------------------------------------- 
 vda - 07-21-07 07:15  
---------------------------------------------------------------------- 
lock is too generic for a name. filelock?

Needs busybox'ification a lot:
* usage text has to be in usage.h
* usage text is too terse (doesn't explain what applet is doing)
* nuke "static int unlock" flags, use option_mask32 (many examples in
other applets)
* fprintf(stderr, "Can't open %s\n", file) => bb_perror_msg[_and_die]

I'm a bit curious how you are actually using this applet. 

---------------------------------------------------------------------- 
 nbd - 07-23-07 04:46  
---------------------------------------------------------------------- 
I wrote this applet to avoid race conditions in OpenWrt, where certain
scripts (e.g. network scripts) may be called from hotplug and from the
command line at the same time.
If you have a use for this thing, I will clean it up and submit a new
patch. 

---------------------------------------------------------------------- 
 bernhardf - 07-23-07 05:34  
---------------------------------------------------------------------- 
nbd, This sounds rather like a reimplementation of creating lockfiles (and
honouring them) in /var/lock/*

Anyway. If you folks need it then you should really rewrite it with size
in mind (and reuse busybox's facilities), imho.
Please run the patch through the mailing list for comments if you desire
it to be applied to busybox. TIA

cheers, 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-20-07 05:04  mirabilos      New Issue                                    
07-20-07 05:04  mirabilos      Status                   new => assigned     
07-20-07 05:04  mirabilos      Assigned To               => BusyBox         
07-20-07 05:04  mirabilos      File Added: 340-lock_util.patch                  
 
07-21-07 07:15  vda            Note Added: 0002613                          
07-23-07 04:46  nbd            Note Added: 0002633                          
07-23-07 05:34  bernhardf      Note Added: 0002635                          
======================================================================




More information about the busybox-cvs mailing list