[upstream] Batch libreoffice --convert-to offers no way to wait for document completion
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LibreOffice |
Won't Fix
|
Medium
|
|||
libreoffice (Ubuntu) |
Opinion
|
Low
|
Unassigned |
Bug Description
Command-line: libreoffice --convert-to odt:writer8 myfile.txt
The returned status code ($?) is zero. So far, so good. But, when I try to access the ODT file (E.g. copy it), it doesn't yet exist.
Adding `sync; sync; sync` right after the libreoffice batch execution did not help.
Adding --headless as an option did not help.
If I sleep for a few seconds immediately after the libreoffice batch execution, then the file finally gets completed before a subsequent command references the ODT file.
Sample script:
### Create somehow a file called myfile.txt
rm myfile.odt somewhere-else.odt
libreoffice --headless --convert-to odt:writer8 myfile.txt
RC=$?
if [ $RC -ne 0 ]; then
echo '*** libreoffice conversion failed for myfile.txt'
exit 86
fi
#sleep 3
ls *.odt
Result: ls: cannot access '*.odt': No such file or directory
If one changes the above script so that the sleep is executed, then the ODT file is available.
Observation: It appears that executing libreoffice in batch mode is somehow kicking off a separate process to finish the ODT file. The exit to the shell and the availability of the ODT file should be synchronized.
Before 18.04, I never saw this behavior.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libreoffice 1:6.0.3-0ubuntu1
ProcVersionSign
Uname: Linux 4.15.0-23-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CurrentDesktop: XFCE
Date: Sat Jun 16 17:07:02 2018
InstallationDate: Installed on 2017-10-13 (246 days ago)
InstallationMedia: Xubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170926)
SourcePackage: libreoffice
UpgradeStatus: Upgraded to bionic on 2018-05-18 (29 days ago)
Changed in df-libreoffice: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in df-libreoffice: | |
status: | Confirmed → New |
summary: |
- Batch libreoffice --convert-to offers no way to wait for document - completion + [upstream] Batch libreoffice --convert-to offers no way to wait for + document completion |
Changed in libreoffice (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in df-libreoffice: | |
status: | New → Incomplete |
Changed in df-libreoffice: | |
status: | Incomplete → Won't Fix |
Description:
Command-line: libreoffice --headless --convert-to odt:writer8 myfile.txt
The returned status code ($?) is zero. So far, so good.
But, when I try to use the ODT file (E.g. copy it), it doesn't exist yet.
Yes, I tried `sync; sync; sync` but it did not help.
If I add a `sleep 1` immediately after checking the status code, then this seems to allow enough time for some libreoffice subprocess (?) to finish.
Before version 6, I did not need the sleep step. Maybe, this is some sort of optimization? If so, please provide an option to indicate that libreoffice should hold up the process until the desired output is available.
I am using libreoffice 1:6.0.3-0ubuntu1 on Xubuntu 18.04.
`libreoffice --help` shows:
LibreOffice 6.0.3.2 00m0(Build:2)
Steps to Reproduce:
Linux batch script, starting with an existing text file called "myfile.txt":
libreoffice --headless --convert-to odt:writer8 myfile.txt
RC=$?
if [ $RC -ne 0 ]; then
echo '*** libreoffice conversion failed for myfile.txt'
exit 86
fi
cp myfile.odt somewhere-else.odt
Actual Results:
cp: cannot stat 'myfile.odt': No such file or directory
Expected Results:
Copy completes as normal because myfile.odt is available.
Reproducible: Always
User Profile Reset: No
Additional Info:
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0