clear_locks(8) on Solnix vs Linux and the BSDs

On Solnix, clear_locks is the illumos command at /usr/sbin/clear_locks. It removes all file, record and share locks that a named host holds on the local host. Unlike FreeBSD, it also has -s, which clears locks the current machine holds on a server.

What Solnix runs

A default Solnix system runs the illumos clear_locks at /usr/sbin/clear_locks. No other variants are shipped. Linux, OpenBSD and NetBSD have no counterpart page in the bundle, so the manual says nothing about them.

Differences

Compared withTopicWhat differs
FreeBSD-s optionSolnix clear_locks has -s, which removes all locks created by the current machine and held by the server hostname. The FreeBSD synopsis is only clear_locks hostname and documents no options.
Source: Solnix clear_locks(8) SYNOPSIS, OPTIONS -s; FreeBSD clear_locks(8) SYNOPSIS
FreeBSDwhat is clearedSolnix states that it removes all file, record and share locks created by hostname and held on the current host, whichever process owns them. FreeBSD says only that it clears file locks held by an NFS client.
Source: Solnix clear_locks(8) DESCRIPTION; FreeBSD clear_locks(8) DESCRIPTION
FreeBSDprivilege requirementSolnix says the command can be run only by the super-user and exits 1 if you are not root. The FreeBSD page does not mention any privilege requirement.
Source: Solnix clear_locks(8) DESCRIPTION, EXIT STATUS 1; FreeBSD clear_locks(8) DESCRIPTION
FreeBSDexit statusSolnix documents exit codes: 0 success, 1 not root, 2 usage error, 3 unable to contact the server (RPC). The FreeBSD page has no EXIT STATUS section, so scripts cannot rely on specific codes there.
Source: Solnix clear_locks(8) EXIT STATUS; FreeBSD clear_locks(8) (no EXIT STATUS section)
FreeBSDwarning about active clientsSolnix warns that clearing locks held by an active client may make applications fail unexpectedly. The FreeBSD page only says to use it after a client crash and does not give this warning.
Source: Solnix clear_locks(8) DESCRIPTION; FreeBSD clear_locks(8) DESCRIPTION
FreeBSDrelated pagesSolnix refers to fcntl(2) and attributes(7). FreeBSD refers to rpc.lockd(8). The Solnix page does not name a lock daemon.
Source: Solnix clear_locks(8) SEE ALSO; FreeBSD clear_locks(8) SEE ALSO

Standards

  • POSIX: clear_locks is not a POSIX.1-2024 utility.
  • FreeBSD: HISTORY: A version of clear_locks appeared in SunOS 4.

Writing portable scripts

  • Do not pass -s in scripts that must also run on FreeBSD: its page documents only clear_locks hostname.
  • Do not depend on exit codes 1 to 3 outside Solnix: only the Solnix page documents them.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.