| PKGOS-SBUILD-LOCK(1) | Debian OpenStack packaging | PKGOS-SBUILD-LOCK(1) |
NAME¶
pkgos-sbuild-lock - acquire or release the OpenStack repository update lock
SYNOPSIS¶
pkgos-sbuild-lock acquire
pkgos-sbuild-lock release
DESCRIPTION¶
pkgos-sbuild-lock serializes access to the Debian repository rebuild steps performed by the OpenStack build infrastructure (for example scanning the repository with pkgos-scan-repo(1) after a build), so that concurrent package builds do not update the repository at the same time.
acquire blocks without limit until the lock is available. The lock is then held, in the background, by a holder process which is detached from the caller's standard input, output and error streams: hooks capturing their output through a pipe, like sbuild's external commands do, see their pipe closed as soon as acquire returns. The lock is held as long as the calling process lives: the holder watches the PID of the calling process, and exits by itself when it is gone, so that an aborted or crashed build never leaves the lock behind. The holder's and the caller's PIDs are recorded in the PID file.
release removes the PID file and kills the holder process, which releases the lock. It is a no-op when no lock is held, and can also be used by hand to clear a lock left in a strange state.
OPTIONS¶
FILES¶
- /var/lock/pkgos-repository.lock
- The lock file on which an exclusive flock is held.
- /var/lock/pkgos-repository-lock.pid
- The PID file holding the PID of the holder process and of the calling process.
EXAMPLES¶
Holding the repository lock during the build dependency download stage of sbuild(1), through its external command hooks, so that the repository can be updated while builds are running, but not while build dependencies are being downloaded from it:
$use_download_only_stage = 1;
$external_commands = {
'pre-build-commands' => [
'pkgos-sbuild-lock acquire',
],
'after-build-depends-download-commands' => [
'pkgos-sbuild-lock release',
],
'anything-failed-commands' => [
'pkgos-sbuild-lock release',
],
};
SEE ALSO¶
AUTHOR¶
This script and its man page: (c) 2026, Thomas Goirand <zigo@debian.org>, released under the Apache-2.0 license.
| 1 November 2026 | openstack-pkg-tools |