PMLOCK(1)
π PMLOCK(1) π
bestie!! welcome to section 1 of the General Commands Manual, aka the part of the manual where we talk about pmlock. it's a whole command, it lives at $PCP_BINADM_DIR/pmlock, and it's here to be your tiny little lock girlie. let's get into it β¨
πΈ NAME πΈ
pmlock β simple file-based mutex. that's it, that's the whole vibe. it locks stuff by existing. iconic behavior honestly π
π¦ SYNOPSIS π¦
$PCP_BINADM_DIR/pmlock [-i ident] [-v] file
β¨ DESCRIPTION β¨
okay so here's the tea. pmlock tries to acquire an exclusive lock, and the way it does that is by creating a zero-sized file with a mode of 0. no content, no permissions, just vibes and exclusivity. very demure, very mindful π
then there's the -i option, which is where things get a little different. when you use it, the behavior switches up: instead of an empty file, it writes ident into file, followed by a newline, and the file mode becomes 0444. so now your lock file has receipts π«Ά
ident is an arbitrary string, so like, technically you can put whatever you want in there. but by convention it's the process id of the locker, followed by the name or identification of the locker command or script. do that. be a good citizen π§
the exit status is 0 for success and 1 for failure. no in-between, no "it depends", just those two. periodt.
when you're done and you wanna let the lock go? to release the lock, remove file with rm(1) or unlink(2). bye bye lock file, you served your purpose π
and listen β in the event of a failure, the -v option produces an explanatory message on stderr. so if something goes sideways, -v will actually tell you what's up instead of leaving you on read. use it, bestie π
π OPTIONS π
-iident β changes the behavior so it writesidentinto file followed by a newline, and the file mode is0444.identis an arbitrary string, but by convention it's the process id of the locker followed by the name or identification of the locker command or script. π-vβ in the event of a failure, produces an explanatory message onstderr. lowkey essential when things go wrong π
π SEE ALSO π
rm(1) and unlink(2). that's the whole squad π«Ά
and that's the page!! this one came to you from Performance Co-Pilot (PCP) β the source/version tag is right there on the tin, and the manual name is PMLOCK(1) in case you forgot which page you were on. mwah, go lock something responsibly πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: pcp 7.1.1-1
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms