unoconv / unoserver

MIT License
495 stars 69 forks source link

How to start service properly? #87

Closed ostasevych closed 6 months ago

ostasevych commented 9 months ago

I am using unoconverter in my lua web project to convert files on demand. What is the proper way of starting the process and releasing it from the memory?

By now I have just created a systemd unit service and made it started on boot? Are any other ways of starting the service when needed and releasing it from memory when finished in order not to keep it in memory?

Thanks!

regebro commented 9 months ago

There is no problem way, that entirely depends on context. You can use systemd, that's fine. Or any other way to start a service. We have been using supervisors previously, I don't know what we are using right now.

Of course, the simplest way of starting it and then releasing it from memory is to just start it with unoserver and then pressing CTRL-C when you are done.

ostasevych commented 9 months ago

There is no problem way, that entirely depends on context. You can use systemd, that's fine. Or any other way to start a service. We have been using supervisors previously, I don't know what we are using right now.

Of course, the simplest way of starting it and then releasing it from memory is to just start it with unoserver and then pressing CTRL-C when you are done.

Thanks for your reply! Actually, I liked the way how obsolete unoconv works: when called from script it just automatically starts, run the job and quits, so there's no need to have additional service running. However, in case of errors (eg mismatch in filters it may easily stuck). Is it possible to add this layer of self-demonisation upon demand?

I was looking for a docker solution, however, again unoconv is much easier and helpful, while unoserver demands data volumes to be exported.

Manual initiation and breaking is not my way definitely, at the same time to keep LibreOffice constantly running and occupying resources is also exhaustive approach, IMO... :/

regebro commented 9 months ago

The thing is that both unoconv and unoserver only uses Libreoffice to do the converting. If you don't start a server you don't need unoconv or unoserver, you can just use Libreoffice. So I intentionally did not include such a feature, because it just means people used unoconv when they didn't need to, and had problems that would otherwise not have had.

So if you like that way of using unoconv, just use Libreoffice directly.

ostasevych commented 9 months ago

The thing is that both unoconv and unoserver only uses Libreoffice to do the converting. If you don't start a server you don't need unoconv or unoserver, you can just use Libreoffice. So I intentionally did not include such a feature, because it just means people used unoconv when they didn't need to, and had problems that would otherwise not have had.

So if you like that way of using unoconv, just use Libreoffice directly.

Well, couldn't use it from web script, and don't know why it is not working, but unoserv/unoconv. Meanwhile, Is that possible to create a unoserv docker which is not demanding binding volumes?

regebro commented 9 months ago

I don't know enough about docker to even know what that means.

Try here: https://github.com/unoconv/unoserver-docker