SYNCHRONISATION.SH(1)

πŸ’– SYNCHRONISATION.SH(1) πŸ’–

okay so bestie, welcome to this page from the User Contributed Perl Documentation β€” it's giving process-sync main character energy, and honestly? obsessed. πŸ¦‹ This is where BeakerLib keeps its helpers for making processes wait for each other instead of chaos-spiraling. no cap.

✨ NAME ✨

BeakerLib - synchronisation - Process synchronisation routines

🌸 DESCRIPTION 🌸

This is a library of helpers for process synchronisation of applications. πŸ’…

NOTE: none of these commands will cause the test proper to fail, even in case of critical errors during their invocation. If you want your test to fail if these fail, use their return codes and rlFail(). 🫢

πŸ”₯ FUNCTIONS πŸ”₯

πŸŽ€ Process Synchronisation πŸŽ€

πŸ’« rlWaitForCmd

Pauses script execution until command exit status is the expected value. Logs a WARNING and returns 1 if the command didn't exit successfully before timeout elapsed or a maximum number of invocations has been reached. 😭

rlWaitForCmd command [-p PID] [-t time] [-m count] [-d delay] [-r retval]
  • command β€” Command that will be executed until its return code is equal 0 or the value specified as option to -r. πŸ‘‘
  • -t time β€” Timeout in seconds, default=120. If the command doesn't return 0 before time elapses, the command will be killed. πŸ’€
  • -p PID β€” PID of the process that should also be running. If the process exits before the command exits with the expected exit code, the return code will be set to 1.
  • -m count β€” Maximum number of command executions before continuing anyway. Default is infinite. Returns 1 if the maximum was reached.
  • -d delay β€” Delay between command invocations. Default 1.
  • -r retval β€” Expected return value of command. Default 0.

πŸ’« rlWaitForFile

Pauses script execution until specified file or directory starts existing. Returns 0 if file started existing, 1 if timeout was reached or PID exited. Return code is greater than 1 in case of error. πŸŽ€

rlWaitForFile path [-p PID] [-t time] [-d delay]
  • path β€” Path to file that should start existing.
  • -t time β€” Timeout in seconds (optional, default=120). If the file isn't opened before the time elapses the command returns 1.
  • -p PID β€” PID of the process that should also be running. If the process exits before the file is created, the command returns with status code of 1.
  • -d delay β€” Delay between subsequent checks for existence of file. Default 1.

πŸ’« rlWaitForSocket

Pauses script execution until local socket starts listening. Returns 0 if socket started listening, 1 if timeout was reached or PID exited. Return code is greater than 1 in case of error. 🌈

rlWaitForSocket {port|path} [-p PID] [-t time] [-d delay] [--close] [--remote]
  • port|path β€” Network port to wait for opening or a path to UNIX socket. Regular expressions are also supported.
  • -t time β€” Timeout in seconds (optional, default=120). If the socket isn't opened before the time elapses the command returns 1.
  • -p PID β€” PID of the process that should also be running. If the process exits before the socket is opened, the command returns with status code of 1.
  • -d delay β€” Delay between subsequent checks for availability of socket. Default 1.
  • --close β€” Wait for the socket to stop listening.
  • --remote β€” Wait for the remote socket to start listening instead of local one.

πŸ’« rlWait

Wrapper around bash builtin wait command. See bash_builtins(1) man page. Kills the process and all its children if the timeout elapses. 😀

rlWait [n ...] [-s SIGNAL] [-t time]
  • n β€” List of PIDs to wait for. They need to be background tasks of current shell. See bash_builtins(1) section for wait command.
  • -t time β€” Timeout in seconds (optional, default=30). If the wait isn't successful before the time elapses then all specified tasks are killed.
  • -s SIGNAL β€” Signal used to kill the process, optional SIGTERM by default.

πŸ‘‘ AUTHORS πŸ‘‘

  • Hubert Kario <hkario@redhat.com>

mwah πŸ’‹ and that's the whole page, bestie! footer deets: perl v5.32.1, dated 2026-04-07, manual name SYNCHRONISATION.SH(1). periodt. πŸ’–

πŸ“¦ where this page comes from