CYR_WITHLOCK_RUN(8)

πŸ“¦
version 3.12.4 Β· 3 versions
, in fedora 44

πŸ’– cyr_withlock_run πŸ’–

okay bestie, welcome to the manual page for cyr_withlock_run β€” it's a Cyrus IMAP thing, it lives in section 8 of the manual (that's the sysadmin/system commands girlies, iykyk), and it's literally used to run system command with a lock held. ✨

🚨 WARNING: This command runs as the Cyrus user, so if you need to call something as root, the cyrus user may need sudo privileges. no cap, plan for that.

✨ SYNOPSIS ✨

cyr_withlock_run [ -C config-file ] [ -u userid ] cmd args...

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: cyr_withlock_run will run the command and arguments provided on the command line, and it does that while either locking the entire server, or just a particular user, so no changes can be made to it while this command is running. locked in fr fr πŸ”’

πŸ’€ WARNING: since this takes an exclusive lock, it will deadlock if the command tries to connect to Cyrus via IMAP/JMAP/etc and run commands that take exclusive locks. like, it will just sit there. forever. staring at you. 😭 You can run cyrus commandline tools so long as the environment is passed through.

It is most useful for running an external filesystem snapshot command β€” you can run it safely, knowing that files aren't in a partial state. iconic behavior honestly 🫢

cyr_withlock_run reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C. πŸ“„


πŸŽ€ OPTIONS πŸŽ€

  • -C config-file β€” Use the specified configuration file config-file rather than the default imapd.conf(5). πŸ—‚οΈ
  • -u, --user <userid> β€” Lock just the specified userid rather than the global lock. πŸ’…
πŸ“Œ NOTE: if you run for the global lock, then your server must have the global_lock config option set, or this command will fail with an error as it can't get a guaranteed lock. no global_lock, no guaranteed lock, no service bestie πŸ™ˆ

🌈 EXAMPLES 🌈

cyr_withlock_run sleep 300

Pause all writes on the server for 300 seconds (stops any writes from getting locks). three hundred seconds of pure, uninterrupted calm. the server is meditating. πŸ§˜β™€οΈβœ¨


πŸ“ FILES πŸ“

  • /etc/imapd.conf

🌸 ENVIRONMENT 🌸

Sets the CYRUS_HAVELOCK_GLOBAL or CYRUS_HAVELOCK_USER environment variables, to tell any called cyrus command that this lock is already held. it's like passing a note in the group chat: "we already got the lock, chill" πŸ’Œ


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

The Cyrus Team, Bron Gondwana


1993–2026, The Cyrus Team


and that's the whole page, bestie!! πŸŽ€ this was version 3.12.4, dated Sep 09, 2026, brought to you by the Cyrus IMAP girlies πŸ’– go forth and snapshot safely, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from