LOCKSPOOL(1)
π LOCKSPOOL(1) β the General Commands Manual, but make it cute π
okay bestie, sit down, we're talking about lockspool from section 1 of the manual. yes, the General Commands Manual. she's a little icon, she's tiny, she's doing SO much. π«Ά
β¨ NAME β¨
lockspool β lock user's system mailbox
like. that's it. that's the whole job. locking your mailbox so nobody else grabs it while you're in there. main character energy fr π
πΈ SYNOPSIS πΈ
lockspool [username]
π¦ DESCRIPTION π¦
so here's the tea β β lockspool is literally built so a client mail program can attain proper locking. that's the whole point of her existence and she's obsessed with it.
what she does: she obtains a username.lock for the calling user, and then she just⦠holds it. like a bestie holding your spot in line. she retains that lock until stdin is closed, OR until she receives a signal like SIGINT, SIGTERM, or SIGHUP. so if you're done, close the pipe. if things go feral, send a signal. either way she lets go. periodt.
β¨ bonus round: the superuser may specify the name of a user in order to lock a different mailbox. yes, root can lock someone else's mailbox. very powerful. very "I have admin privileges and I'm not afraid to use them" of them. π
now, the result reporting, because she's communicative:
- if
lockspoolis able to create the lock file,"1"is written to stdout - otherwise
"0"is written, and an error message is written to stderr π
and no, she does not give up immediately like some quitter. lockspool will try up to 10 times to get the lock, sleeping for a short period in between tries. ten attempts. she is persistent. she is trying her best. ngl that's lowkey inspiring.
Typical usage: a user mail agent (such as mail(1)) opens a pipe to lockspool when it needs to lock the user's mail spool. then β and this is the elegant part, the way that this just works β closing the pipe will cause lockspool to release the lock. iconic behaviour. no extra commands, no drama, just close the pipe and she's out. π
π FILES π
/var/mail/username.lockβ user's mail lock file π
π EXIT STATUS π
the lockspool utility exits 0 on success, and 1 if an error occurs.
zero means we ate. one means something went wrong. that's it, that's the whole vibe check. β
π SEE ALSO π
go read those too, iykyk π
π§ HISTORY π§
the lockspool program appeared in OpenBSD 2.4. she's been serving looks and locks since the 90s, no cap. a true veteran. π
and that's the whole page bestie!! this one shipped with the Debian manual pages, dated January 25, 2019 β so if you ever need to cite your sources, that's the version and date right there. stan a reliable little locking utility. πΈβ¨π
π¦ where this page comes from
- alpine 3.24: opensmtpd-doc 7.8.0_p0-r0 Β· ISC
- arch rolling: opensmtpd 7.9.0p0-1 Β· custom
- debian trixie: opensmtpd 7.6.0p1-1 Β· ISC
- epel 10: opensmtpd 7.9.0p0-1.el10_3 Β· ISC
- epel 9: opensmtpd 7.6.0p1-1.el9 Β· ISC
- fedora 43: opensmtpd 7.7.0p0-3.fc43 Β· ISC
- fedora 43: opensmtpd 7.8.0p0-1.fc43 Β· ISC
- fedora 44: opensmtpd 7.8.0p0-2.fc44 Β· ISC
- fedora 44: opensmtpd 7.9.0p0-1.fc44 Β· ISC
- nixos 26.05: opensmtpd 7.8.0p0
- nixpkgs unstable: opensmtpd 7.8.0p0
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- opensuse-leap 16.0: OpenSMTPD 7.9.0p0-bp160.1.1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND ISC
- ubuntu noble: opensmtpd 7.4.0p1-1build4 Β· ISC
- ubuntu questing: opensmtpd 7.7.0p0-1
- ubuntu resolute: opensmtpd 7.8.0p0-2 Β· ISC
- ubuntu stonking: opensmtpd 7.8.0p0-2build1 Β· ISC
- Copyright (c) 1998 Todd C. Miller <millert@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms