Can Libreoffice save and close automatically upon shutdown?

Is it possible to set Writer (or all of the Libreoffice variants) to save and close automatically when the computer has been ordered to shutdown?

Libreoffice is very good about recovering documents when I forget to do this, but I’d sooner avoid the necessity!

Thanks!

It shouldn’t be done. Saving files can sometimes take tens of seconds; and Windows may simply terminate applications that don’t shutdown gracefully in about 5 seconds. If that happens when the app is writing files, there could be data corruption.

1 Like

I should have specified that I usually use Linux. I am tempted to make a rude remark about Windows, but I see that this objection might apply equally well to Linux.
I would have expected that any operating system would delay its shutdown to deal with necessary housekeeping–but yes, I should be prepared to do some housekeeping myself!

Windows has a default shutdown time-out for services of 5s that is configured in the Registry.

[Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"WaitToKillServiceTimeout"="5000"

This can be extended to any period you like. For example, if set to 20s, then the Windows system shutdown delays up to 20s, but if all the services shutdown before the timeout, then Windows proceeds with shutting down. There is still the risk of documents not being saved before the timeout, but with modern fast SSDs, I would say the risk is low.

I would guess that Linux would have a similar solution (using configurable timeouts) for managing OS shutdowns/reboots.

That timeout has nothing to do with user applications (as opposed to services). And even it it had - it is not a task of the application, to change those system settings (and there is no permission to do that for a normal application run without admin permissions; and not all instances of LibreOffice are installed, e.g. portable …) - so all that is unrelated.

I too want a solution here (even if I am a Windows user :slight_smile:).

MS-Office Word, and other MS-Office apps, do not prompt for the document to be saved if changes has been made at the time Windows is shutdown/rebooted. Upon restarting Windows and opening the document, a message in the toolbar says this is recovered document and prompts the document to be saved.

I have gotten so use to this behavior, that I find LibreOffice annoying that:

  1. I am prompted that LibreOffice Writer is preventing a shutdown of Windows until the services kill timeout occurs and Windows shuts down. Annoying.
  2. Upon Windows restart, I am prompted with a recovery dialog (also annoying)

To me modern software applications should save when I want them to be saved (manually saved) and changes be maintained between editing sessions, including OS shutdowns/reboots.

Other apps, such as Notepad++ and Windows Notepad, have this behavior and I rely on it all the time for temporary notes. I then save what I want to persist.

I have looked at the LibreOffice bug list if this is a requested feature but I could not find it.

But that is not auto-save, but crash-recovery. And you can use this with LibreOffice also. I would never recommend this as I assume it will work usually until there is the day when it is not working. Ther users come here and write, “I never lost data, but now my file has 0 bytes…”
.
MS is moving in the cloud, so “saving” is something else there. As LibreOffice is a classic desktop software you may xheck out Collabora or similiar software instead.

Is that really true? (just politely asking). LibreOffice QuickStarter soffice.bin" runs separate to the LibreOffice apps and they appear to run as child processes.

Also, the document recovery function does keep-and-track unsaved changes in LibreOffice between reboots/shutdowns. I do not want to change the keep-and-track unsaved changes behavior except remove the prompts that stops the shutdown and the prompts to recover.
Just treat the unsaved changes as a continuation of an interrupted user session.

@Wanderer : I agree with you this would be “crash recovery” in LibreOffice and I am also uncomfortable about using LibreOffice this way if this is not what it was not was intended (which it seems not).
As for MS-Office I have been using it for years this way and not had a problem (touch wood). Recovery files (for unsaved changes) are stored locally and not in the cloud.
What I am seeking is for document changes to be maintained across sessions and saved when I want it (manually) saved. This would be is independent of cloud or local storage.
Google Docs does work the way I like, however, I prefer not to be locked into Google document formats and Google tools.
Any hoo, Good discussion. I may need to rethink my needs.

No. The process is same, no child processes. If you refer to soffice.exe (or sometimes soffice.com), these are simple launcher / guard processes, actually doing ~nothing useful (well, their actual task is to prepare command line / environment for soffice.bin, launch it, and monitor its exit value, to maybe re-launch it, when the exit value requires that - see e.g. its Windows implementation). Every new process that you launch will detect that soffice.bin already runs, and will pass own command line to that pre-existing process, and exit.