fix: 隔离 LibreOffice 并发转换配置
- 为每次 soffice 调用创建独立临时用户配置目录 - 转换结束后自动清理并保持无头安全启动参数
This commit is contained in:
21
docker-soffice-wrapper.sh
Normal file
21
docker-soffice-wrapper.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
profile_parent="${TMPDIR:-/tmp}"
|
||||
profile_dir="$(mktemp -d "${profile_parent%/}/easyflow-soffice-XXXXXX")"
|
||||
|
||||
cleanup() {
|
||||
rm -rf -- "$profile_dir"
|
||||
}
|
||||
|
||||
trap cleanup EXIT HUP INT TERM
|
||||
|
||||
/usr/bin/soffice \
|
||||
-env:UserInstallation="file://${profile_dir}" \
|
||||
--headless \
|
||||
--safe-mode \
|
||||
--nologo \
|
||||
--nodefault \
|
||||
--nolockcheck \
|
||||
--norestore \
|
||||
"$@"
|
||||
Reference in New Issue
Block a user