Page MenuHomeFreeBSD

lockf: add a -T option to terminate the child upon early abort
ClosedPublic

Authored by kevans on Jun 24 2025, 11:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 11, 2:58 AM
Unknown Object (File)
Tue, Oct 28, 4:28 AM
Unknown Object (File)
Oct 24 2025, 11:46 PM
Unknown Object (File)
Oct 14 2025, 1:56 AM
Unknown Object (File)
Oct 14 2025, 1:56 AM
Unknown Object (File)
Oct 14 2025, 1:56 AM
Unknown Object (File)
Oct 13 2025, 12:25 PM
Unknown Object (File)
Oct 7 2025, 5:14 AM
Subscribers

Details

Summary

This is useful to avoid having the command running twice in the face of
the admin terminating the process. Notably, if the -p option is not in
use (or can't be used, e.g., because we can't open the file for writing)
then this provides a nice alternative where one simply needs to send a
SIGTERM to the lockf(1) process associated with the lock file to clean
it all up.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.bin/lockf/lockf.c
68

Should you also convert fdlock, keep, silent, and writepid to bool?

usr.bin/lockf/lockf.c
68

The cosmetic changes are later in the stack, though I did miss fdlock: https://reviews.freebsd.org/D51027

This revision is now accepted and ready to land.Jul 1 2025, 10:34 AM