# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2024-03-29 09:39+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: TH #: debian-bookworm #, no-wrap msgid "FLOCK" msgstr "" #. type: TH #: debian-bookworm #, no-wrap msgid "2022-05-11" msgstr "" #. type: TH #: debian-bookworm #, no-wrap msgid "util-linux 2.38.1" msgstr "" #. type: TH #: debian-bookworm #, no-wrap msgid "User Commands" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "NAME" msgstr "" #. type: Plain text #: debian-bookworm msgid "flock - manage locks from shell scripts" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "SYNOPSIS" msgstr "" #. type: Plain text #: debian-bookworm msgid "B [options] I|I I [I]" msgstr "" #. type: Plain text #: debian-bookworm msgid "B [options] I|I B<-c> I" msgstr "" #. type: Plain text #: debian-bookworm msgid "B [options] I" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "DESCRIPTION" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "This utility manages B(2) locks from within shell scripts or from the " "command line." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The first and second of the above forms wrap the lock around the execution " "of a I, in a manner similar to B(1) or B(1). They lock " "a specified I or I, which is created (assuming appropriate " "permissions) if it does not already exist. By default, if the lock cannot be " "immediately acquired, B waits until the lock is available." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The third form uses an open file by its file descriptor I. See the " "examples below for how that can be used." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "OPTIONS" msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-c>, B<--command> I" msgstr "" #. type: Plain text #: debian-bookworm msgid "Pass a single I, without arguments, to the shell with B<-c>." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-E>, B<--conflict-exit-code> I" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The exit status used when the B<-n> option is in use, and the conflicting " "lock exists, or the B<-w> option is in use, and the timeout is reached. The " "default value is B<1>. The I has to be in the range of 0 to 255." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-F>, B<--no-fork>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Do not fork before executing I. Upon execution the flock process is " "replaced by I which continues to hold the lock. This option is " "incompatible with B<--close> as there would otherwise be nothing left to " "hold the lock." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-e>, B<-x>, B<--exclusive>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Obtain an exclusive lock, sometimes called a write lock. This is the default." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-n>, B<--nb>, B<--nonblock>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Fail rather than wait if the lock cannot be immediately acquired. See the B<-" "E> option for the exit status used." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-o>, B<--close>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Close the file descriptor on which the lock is held before executing " "I. This is useful if I spawns a child process which should " "not be holding the lock." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-s>, B<--shared>" msgstr "" #. type: Plain text #: debian-bookworm msgid "Obtain a shared lock, sometimes called a read lock." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-u>, B<--unlock>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Drop a lock. This is usually not required, since a lock is automatically " "dropped when the file is closed. However, it may be required in special " "cases, for example if the enclosed command group may have forked a " "background process which should not be holding the lock." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-w>, B<--wait>, B<--timeout> I" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Fail if the lock cannot be acquired within I. Decimal fractional " "values are allowed. See the B<-E> option for the exit status used. The zero " "number of I is interpreted as B<--nonblock>." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<--verbose>" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Report how long it took to acquire the lock, or why the lock could not be " "obtained." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-h>, B<--help>" msgstr "" #. type: Plain text #: debian-bookworm msgid "Display help text and exit." msgstr "" #. type: Plain text #: debian-bookworm msgid "B<-V>, B<--version>" msgstr "" #. type: Plain text #: debian-bookworm msgid "Print version and exit." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "EXIT STATUS" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The command uses Esysexits.hE exit status values for everything, " "except when using either of the options B<-n> or B<-w> which report a " "failure to acquire the lock with an exit status given by the B<-E> option, " "or 1 by default. The exit status given by B<-E> has to be in the range of 0 " "to 255." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "When using the I variant, and executing the child worked, then the " "exit status is that of the child command." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "NOTES" msgstr "" #. type: Plain text #: debian-bookworm msgid "B does not detect deadlock. See B(2) for details." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Some file systems (e. g. NFS and CIFS) have a limited implementation of " "B(2) and flock may always fail. For details see B(2), " "B(5) and B(8). Depending on mount options, flock can always " "fail there." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "EXAMPLES" msgstr "" #. type: Plain text #: debian-bookworm msgid "Note that \"shellE \" in examples is a command line prompt." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "shell1E flock /tmp -c cat; shell2E flock -w .007 /tmp -c echo; /bin/" "echo $?" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Set exclusive lock to directory I and the second command will fail." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "shell1E flock -s /tmp -c cat; shell2E flock -s -w .007 /tmp -c " "echo; /bin/echo $?" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Set shared lock to directory I and the second command will not fail. " "Notice that attempting to get exclusive lock with second command would fail." msgstr "" #. type: Plain text #: debian-bookworm msgid "shellE flock -x local-lock-file echo \\(aqa b c\\(aq" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Grab the exclusive lock \"local-lock-file\" before running echo with \\(aqa " "b c\\(aq." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "(; flock -n 9 || exit 1; # ... commands executed under lock ...; ) 9E/" "var/lock/mylockfile" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The form is convenient inside shell scripts. The mode used to open the file " "doesn\\(cqt matter to B; using I> or IE> allows the " "lockfile to be created if it does not already exist, however, write " "permission is required. Using I> requires that the file already exists " "but only read permission is required." msgstr "" #. type: Plain text #: debian-bookworm msgid "" "[ \"${FLOCKER}\" != \"$0\" ] && exec env FLOCKER=\"$0\" flock -en \"$0\" " "\"$0\" \"$@\" || :" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "This is useful boilerplate code for shell scripts. Put it at the top of the " "shell script you want to lock and it\\(cqll automatically lock itself on the " "first run. If the environment variable B<$FLOCKER> is not set to the shell " "script that is being run, then execute B and grab an exclusive non-" "blocking lock (using the script itself as the lock file) before re-execing " "itself with the right arguments. It also sets the B environment " "variable to the right value so it doesn\\(cqt run again." msgstr "" #. type: Plain text #: debian-bookworm msgid "shellE exec 4EE/var/lock/mylockfile; shellE flock -n 4" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "This form is convenient for locking a file without spawning a subprocess. " "The shell opens the lock file for reading and writing as file descriptor 4, " "then B is used to lock the descriptor." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "AUTHORS" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "COPYRIGHT" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "Copyright © 2003-2006 H. Peter Anvin. This is free software; see the source " "for copying conditions. There is NO warranty; not even for MERCHANTABILITY " "or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "SEE ALSO" msgstr "" #. type: Plain text #: debian-bookworm msgid "B(2)" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "REPORTING BUGS" msgstr "" #. type: Plain text #: debian-bookworm msgid "For bug reports, use the issue tracker at" msgstr "" #. type: SH #: debian-bookworm #, no-wrap msgid "AVAILABILITY" msgstr "" #. type: Plain text #: debian-bookworm msgid "" "The B command is part of the util-linux package which can be " "downloaded from" msgstr ""