[PATCH] flock man page: More useful example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The example in the man page does not prevent concurrent execution, as it
obtains a shared lock. More useful is taking an exclusive lock, i.e.
remove "-s".
Additionally, IMO most people want the script to exit when the lock
cannot be acquired, so adding "-n".

diff --git a/sys-utils/flock.1 b/sys-utils/flock.1
index 6ae584b..00ea9b9 100644
--- a/sys-utils/flock.1
+++ b/sys-utils/flock.1
@@ -51,7 +51,7 @@ used the following manner:
 .PP
 \fC(
 .br
-  flock -s 9
+  flock -n 9
 .br
   # ... commands executed under lock ...
 .br
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux