From: Tomas Hlavaty <tom@logand.com>
To: Jean Louis <bugs@gnu.support>
Cc: Felix Dietrich <felix.dietrich@sperrhaken.name>, help-gnu-emacs@gnu.org
Subject: Re: How I am handling msmtp queues
Date: Mon, 14 Mar 2022 21:51:20 +0100 [thread overview]
Message-ID: <87fsnkxnp3.fsf@logand.com> (raw)
In-Reply-To: <87ilskedxn.fsf@sperrhaken.name>
On Fri 11 Mar 2022 at 15:55, Felix Dietrich <felix.dietrich@sperrhaken.name> wrote:
> Jean Louis <bugs@gnu.support> writes:
>> * Felix Dietrich <felix.dietrich@sperrhaken.name> [2022-03-10 19:33]:
>>> Jean Louis <bugs@gnu.support> writes:
>>>> # wait for a lock that another instance has set
>>>> WAIT=0
>>>> while [ -e "$LOCKFILE" -a "$WAIT" -lt "$MAXWAIT" ]; do
>>>>
>>>> # […]
>>>>
>>>> # lock the $QUEUEDIR
>>>> touch "$LOCKFILE" || exit 1
> I think your lock file handling is not race free. There are lock file
> helpers that you may find useful. On Debian, for example:
>
> $ apt-file find bin/lockfile
> lockfile-progs: /usr/bin/lockfile-check
> lockfile-progs: /usr/bin/lockfile-create
> lockfile-progs: /usr/bin/lockfile-remove
> lockfile-progs: /usr/bin/lockfile-touch
> procmail: /usr/bin/lockfile
you probably want
flock
or
flock -n
see (man "flock")
prev parent reply other threads:[~2022-03-14 20:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 6:23 How I am handling msmtp queues Jean Louis
2022-03-10 16:21 ` Felix Dietrich
2022-03-10 18:51 ` Jean Louis
2022-03-11 14:55 ` Felix Dietrich
2022-03-13 14:54 ` Jean Louis
2022-03-14 20:51 ` Tomas Hlavaty [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fsnkxnp3.fsf@logand.com \
--to=tom@logand.com \
--cc=bugs@gnu.support \
--cc=felix.dietrich@sperrhaken.name \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.