From 73dc99c2b06310594099c4fbf73ae615b4b81524 Mon Sep 17 00:00:00 2001 From: Jens Schuppe Date: Thu, 23 Nov 2023 14:19:46 +0100 Subject: [PATCH 1/2] Use "w+" mode for opening/creating the unoconv lock file --- CRM/Civioffice/DocumentRendererType/LocalUnoconv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Civioffice/DocumentRendererType/LocalUnoconv.php b/CRM/Civioffice/DocumentRendererType/LocalUnoconv.php index f1d4745..6fbf47e 100644 --- a/CRM/Civioffice/DocumentRendererType/LocalUnoconv.php +++ b/CRM/Civioffice/DocumentRendererType/LocalUnoconv.php @@ -605,7 +605,7 @@ protected function lock() { $lock_file_path = $this->unoconv_lock_file_path; if ($lock_file_path) { - $this->unoconv_lock_file = fopen($lock_file_path, "r+"); + $this->unoconv_lock_file = fopen($lock_file_path, "w+"); if (!flock($this->unoconv_lock_file, LOCK_EX)) { throw new Exception(E::ts("CiviOffice: Could not acquire unoconv lock.")); } From bfdd1cfd74bd7735b23c32272b752e813cb9b29a Mon Sep 17 00:00:00 2001 From: Sven Nowotnik Date: Mon, 11 Mar 2024 11:27:33 +0100 Subject: [PATCH 2/2] =?UTF-8?q?hilfetext=20zur=20konfiguration=20des=20loc?= =?UTF-8?q?k-files=20von=20unnoconv=20angepasst=20f=C3=BCr=20automatische?= =?UTF-8?q?=20erzeugung=20des=20lock-files.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/CRM/Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl b/templates/CRM/Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl index f808067..d8d57dc 100644 --- a/templates/CRM/Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl +++ b/templates/CRM/Civioffice/Form/DocumentRenderer/Settings/LocalUnoconv.tpl @@ -22,7 +22,7 @@
-
{ts}We strongly recommend creating a system-wide lock file on this server to synchronise access. (It may only run one unoconv process at the same time.) You can create such a file doing this in the server console:
touch /some/accessible/path/unoconv.lock && chmod 777 /some/accessible/path/unoconv.lock
Please note: This path needs to be equal in every civicrm environment on this server. Otherwise, locking is only active for this very civicrm instance!{/ts}
+
{ts}We strongly recommend creating a system-wide lock file on this server to synchronise access. (It may only run one unoconv process at the same time.) Such a file is created automatically at the location shown below. Please note: This path needs to be equal in every civicrm environment on this server. Otherwise, locking is only active for this very civicrm instance!{/ts}
{$form.unoconv_lock_file_path.label}
{$form.unoconv_lock_file_path.html}