https://docs.moodle.org/35/en/api.php?action=feedcontributions&user=Damyon&feedformat=atomMoodleDocs - User contributions [en]2024-03-28T22:47:21ZUser contributionsMediaWiki 1.39.6https://docs.moodle.org/35/en/index.php?title=Document_converters&diff=131977Document converters2018-09-26T00:49:45Z<p>Damyon: </p>
<hr />
<div>{{Managing content}}<br />
Plugins may be installed to convert uploaded [[Assignment settings|assignment submissions]] to PDF format for teachers to annotate. The list of available converters may be accessed from the Plugins section of Site administration.<br />
<br />
There are currently two document converters available as standard plugins:<br />
<br />
*[[Universal Office Converter (unoconv)|Unoconv]] (in 3.2 onwards) requires Unoconv to be installed on a server.<br />
*[[Google Drive converter]] (in 3.3 onwards) requires the [[OAuth 2 Google service]] to be enabled.<br />
<br />
==See also==<br />
<br />
* [https://moodle.org/mod/forum/discuss.php?d=376383 Google Document Converter Slooooooooow] forum discussion<br />
<br />
[[es:Convertidores de documento]]<br />
[[de:Dokumentkonverter]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Document_converters&diff=131976Document converters2018-09-26T00:49:16Z<p>Damyon: Summary of $CFG->conversionattemptlimit</p>
<hr />
<div>{{Managing content}}<br />
Plugins may be installed to convert uploaded [[Assignment settings|assignment submissions]] to PDF format for teachers to annotate. The list of available converters may be accessed from the Plugins section of Site administration.<br />
<br />
There are currently two document converters available as standard plugins:<br />
<br />
*[[Universal Office Converter (unoconv)|Unoconv]] (in 3.2 onwards) requires Unoconv to be installed on a server.<br />
*[[Google Drive converter]] (in 3.3 onwards) requires the [[OAuth 2 Google service]] to be enabled.<br />
<br />
{{Retry failed attempts}}<br />
Sometimes the document converter can fail to convert a single document. This can be because the file is not in a format that is suitable for conversion, or because of a temporary problem with the document converter. For this reason, the Moodle will retry failed conversion attempts up to a limit of 3 times. To adjust the number of retries, change the Moodle config setting "conversionattemptlimit".<br />
<br />
==See also==<br />
<br />
* [https://moodle.org/mod/forum/discuss.php?d=376383 Google Document Converter Slooooooooow] forum discussion<br />
<br />
[[es:Convertidores de documento]]<br />
[[de:Dokumentkonverter]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=OAuth_2_authentication&diff=128820OAuth 2 authentication2017-09-14T02:24:05Z<p>Damyon: /* Troubleshooting */</p>
<hr />
<div>{{Authentication}}{{New features}}<br />
[[File:oauth 2 auth.png|thumb|Login page with options to log in with an OAuth 2 service]]<br />
==Log in using your account on another site==<br />
<br />
The OAuth 2 authentication plugin enables users to log in using their Google, Microsoft and/or Facebook account via buttons on the login page.<br />
<br />
If account creation is enabled, when a user first logs in, a new account will be created. Otherwise, they will be prompted to [[Linked logins|link it to their existing account]] with the same email address.<br />
<br />
==Enabling OAuth 2 authentication==<br />
<br />
To use OAuth 2 authentication, an administrator must first create the required OAuth 2 services.<br />
<br />
# Go to 'OAuth 2 services' in Site administration > Server and click the button to create a new service.<br />
# Follow the instructions in [[OAuth 2 Google service]], [[OAuth 2 Microsoft service]] or [[OAuth 2 Facebook service]] and obtain a client ID and secret.<br />
# Enter the client ID and secret, make sure 'Show on login page' is ticked, then save changes.<br />
<br />
Repeat for additional services as desired. For OAuth 2 authentication, there is no need to connect to a system account.<br />
<br />
Next:<br />
<br />
# Go to 'Manage authentication' in Site administration and enable the OAuth 2 authentication plugin.<br />
# Optional: In the OAuth 2 settings, lock selected user data fields and save changes.<br />
<br />
==Preventing new account creation==<br />
<br />
If you don't want new accounts to be created when users log in with an OAuth 2 service:<br />
<br />
# Go to 'Manage authentication' in Site administration and tick the box 'Prevent account creation when authenticating' (authpreventaccountcreation).<br />
# Click the 'Save changes' button.<br />
<br />
==Troubleshooting==<br />
<br />
===On the 'OAuth 2 services' page, there is a red cross for 'Allow login'===<br />
<br />
To get a green tick for Allow login, edit the OAuth 2 service and make sure that the setting 'Show on login page' is ticked. <br />
<br />
===I obtain a coding error after enabling OAuth 2 authentication===<br />
<br />
Have you any OAuth 2 plugins for earlier versions installed on your site? If so, you will need to [[Installing plugins|uninstall them]] in order to use the standard OAuth 2 authentication.<br />
<br />
===I obtain an error message when attempting to log in using Facebook===<br />
<br />
The error message 'The user information returned did not contain a username and email address. The OAuth 2 service may be configured incorrectly.' is most likely because the user's Facebook account was created using a mobile number.<br />
<br />
The solution is for the user to first log in to Facebook and add a username and email address there.<br />
<br />
=== I see a "required paramenter (code) was missing" error after logging into the OAuth 2 service ===<br />
<br />
The error message 'A required parameter (code) was missing' can be caused by a mis-configured webserver. OAuth 2 relies on long tokens passed as url parameters, and some webserver configurations will prevent this from working. See http://www.php.net/manual/en/reserved.variables.get.php#101469 for one possible solution.<br />
<br />
[[Category:OAuth 2]]<br />
<br />
[[es:Autenticación OAuth 2]]<br />
[[de:OAuth2 Authentifizierung]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=File:linkedin-2-configure-app.png&diff=127989File:linkedin-2-configure-app.png2017-05-23T02:28:33Z<p>Damyon: </p>
<hr />
<div></div>Damyonhttps://docs.moodle.org/35/en/index.php?title=File:linkedin-1-new-app.png&diff=127988File:linkedin-1-new-app.png2017-05-23T02:28:11Z<p>Damyon: </p>
<hr />
<div></div>Damyonhttps://docs.moodle.org/35/en/index.php?title=OAuth_2_LinkedIn_service&diff=127987OAuth 2 LinkedIn service2017-05-23T02:27:56Z<p>Damyon: Created page with "=== Setup App in LinkedIn === To setup an OAuth 2 client with LinkedIn, first we need to login to the https://developer.linkedin.com/ LinkedIn Developers page and create..."</p>
<hr />
<div>=== Setup App in LinkedIn ===<br />
<br />
To setup an OAuth 2 client with LinkedIn, first we need to login to the [[https://developer.linkedin.com/ LinkedIn Developers page]] and create a new app.<br />
<br />
[[File:linkedin-1-new-app.png|none|frame|New App]]<br />
<br />
Enable the r_basicprofile and r_emailaddress permissions and enter the OAuth 2 authorized redirect URL. This is your site url followed by /admin/oauth2callback.php (e.g. for a Moodle site of https://teach.me/moodle/ the callback url should be https://teach.me/moodle/admin/oauth2callback.php)<br />
<br />
[[File:linkedin-2-configure-app.png|none|frame|Configure App]]<br />
<br />
Make sure you save your changes and record your client id and client secret.<br />
<br />
Now you have configured your LinkedIn App - you can add the required information to Moodle.<br />
<br />
LinkedIn does not have a "template" in Moodle so we will need to configure it as a "Custom OAuth 2 Service". From the "Site administration > Server > OAuth 2 services" page click on "Create new custom service".<br />
<br />
Use "LinkedIn" as the name (This is displayed on the login page). <br />
<br />
Enter your client id and secret for the LinkedIn App that you created earlier.<br />
<br />
For the "Scopes included in a login request" and "Scopes included in a login request for offline access" use "r_basicprofile r_emailaddress" which means fetch basic profile information as well as the users email address.<br />
<br />
Enter a url to a logo image.<br />
<br />
Check the box for "Show on login page".<br />
<br />
Save the details and you should be returned to the list of OAuth 2 Services.<br />
<br />
We still need to provide information on the mappings between linked in user fields and moodle fields as well as the URL's to access the LinkedIn APIs.<br />
<br />
First we will setup the API URL's.<br />
<br />
Click on the "Configure Endpoints" icon for the LinkedIn service. <br />
<br />
Add 3 endpoints as listed below.<br />
<br />
<code><br />
userinfo_endpoint https://api.linkedin.com/v1/people/~:(id,email-address,first-name,last-name,picture-url)?format=json <br />
<br />
authorization_endpoint https://www.linkedin.com/oauth/v2/authorization <br />
<br />
token_endpoint https://www.linkedin.com/oauth/v2/accessToken <br />
</code><br />
<br />
Now we need to add the mapping from LinkedIn user fields to Moodle user fields. From the list of OAuth services click on the "Configure user field mappings" icon. <br />
<br />
Add the following user field mappings:<br />
<br />
<code><br />
firstName firstname <br />
lastName lastname <br />
emailAddress username <br />
emailAddress email <br />
pictureUrl picture<br />
</code><br />
<br />
The final step is to make sure the OAuth 2 authentication plugin is enabled and you should now be able to login with LinkedIn.<br />
<br />
[[OAuth2 Services|Back to OAuth 2 Services]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=OAuth_2_services&diff=127986OAuth 2 services2017-05-23T02:27:34Z<p>Damyon: /* How do I get a client ID and secret? */</p>
<hr />
<div>{{Server settings}}{{New features}}<br />
==OAuth2 services==<br />
<br />
Moodle 3.3 adds support for OAuth 2 services, which can be used by any plugin to provide authenticated access to external services either as the current user, or using a system account.<br />
<br />
OAuth 2 services are used for example, to provide a "Login using Google/Microsoft/Facebook" feature on the login page, and then to share that authenticated session with repositories like Google Drive and Office 365 without having to re-authenticate.<br />
<br />
OAuth 2 services can be used by plugins even if they do not use them on the login page, and it's possible to login to multiple services at the same time. <br />
<br />
== Login ==<br />
<br />
See [[OAuth 2 authentication]] for details of how to enable the feature.<br />
<br />
== Open ID Connect ==<br />
<br />
Open ID Connect is a standard for OAuth 2 login services that makes it easier to setup a working login system. If the service you are setting up is Open ID Connect compliant, you will only have to enter the base url for the service, and Moodle will discover all the other information required by requesting the "discovery document" which is expected to exist at <issuer base url>/.well-known/openid-configuration. <br />
<br />
== How do I get a client ID and secret? ==<br />
<br />
The client ID and secret are created outside of Moodle when setting up the OAuth provider. Instructions for prominent OAuth 2 providers are linked here.<br />
<br />
* [[OAuth 2 Google service]]<br />
* [[OAuth 2 Microsoft service]]<br />
* [[OAuth 2 Facebook service]]<br />
* [[OAuth 2 LinkedIn service]]<br />
<br />
==See also==<br />
<br />
* [[:Category:OAuth 2]]<br />
<br />
[[Category:OAuth 2]]<br />
<br />
[[es:Servicios OAuth 2]]<br />
[[de:OAuth2 Services]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=124229Universal Office Converter (unoconv)2016-06-28T07:02:23Z<p>Damyon: /* Installing unoconv on Windows */</p>
<hr />
<div>{{Environment}}<br />
==What is unoconv?==<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the [[Assignment activity]] to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment activities will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with http://brew.sh/ brew.<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with http://brew.sh/ brew<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (''Site administration > Server > System paths''). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.<br />
<br />
There are some ways to get around this - one way is just to give the "_www" user write access to /Library/WebServer. <br />
<br />
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.<br />
Code to insert:<br />
<pre><br />
# Set home to a writable folder. <br />
os.environ['HOME'] = '/tmp/' <br />
</pre><br />
<br />
This needs to be inserted at line 36 immediately after the line "exitcode = 0"<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases (download the zip version). <br />
<br />
From the downloaded zip file - extract the one file "unoconv-0.7\unoconv" (no file extension). This is the unoconv script - none of the other files in the package are required. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to ''Site administration > Server > System paths''<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration > Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time - you need a start up script. Different operating systems and Linux distributions use different startup scripts - but here are some examples of startup scripts for different systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/upstart | Upstart script for Ubuntu based systems]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/launchd | Launchd script for OS X]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
[[Category:Assignment]]<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Feedback_block&diff=123905Feedback block2016-05-26T06:09:36Z<p>Damyon: </p>
<hr />
<div>{{Blocks}}<br />
The Feedback block may be added to courses to provide a quick link to global feedback activities which have been set up from the front page.<br />
<br />
[[File:feedbackblock25.png]]<br />
<br />
<br />
==See also==<br />
[[Feedback settings]]<br />
<br />
<br />
[[es:Bloque de retroalimentación]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/launchd&diff=123742mod/assign/feedback/editpdf/testunoconv/launchd2016-05-23T09:27:58Z<p>Damyon: Created page with "This launchd script will start a unoconv listener at boot time and restart it if it crashes. The HOME directory for the unoconv process will be set to "/tmp/" and the user wil..."</p>
<hr />
<div>This launchd script will start a unoconv listener at boot time and restart it if it crashes. The HOME directory for the unoconv process<br />
will be set to "/tmp/" and the user will be "_www" (default apache user on OS X).<br />
<br />
Copy this script to /Library/LaunchDaemons/unoconv.plist to install it, then run:<br />
<br />
$ sudo launchctl load /Library/LaunchDaemons/unoconv.plist<br />
<br />
to start it.<br />
<br />
Here is the script.<br />
<pre><br />
<?xml version="1.0" encoding="UTF-8"?><br />
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><br />
<plist version="1.0"><br />
<dict><br />
<key>Label</key><br />
<string>Unoconv</string><br />
<key>ProgramArguments</key><br />
<array><br />
<string>/usr/local/bin/unoconv</string><br />
<string>--listener</string><br />
</array><br />
<key>EnvironmentVariables</key><br />
<dict><br />
<key>HOME</key><br />
<string>/tmp/</string><br />
</dict><br />
<key>KeepAlive</key><br />
<true/><br />
<key>UserName</key><br />
<string>_www</string><br />
</dict><br />
</plist><br />
</pre></div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123741Universal Office Converter (unoconv)2016-05-23T09:24:10Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>{{Installing_Moodle}}<br />
==What is unoconv?==<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment activities will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with http://brew.sh/ brew.<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with http://brew.sh/ brew<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (''Site administration > Server > System paths''). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.<br />
<br />
There are some ways to get around this - one way is just to give the "_www" user write access to /Library/WebServer. <br />
<br />
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.<br />
Code to insert:<br />
<pre><br />
# Set home to a writable folder. <br />
os.environ['HOME'] = '/tmp/' <br />
</pre><br />
<br />
This needs to be inserted at line 36 immediately after the line "exitcode = 0"<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to ''Site administration > Server > System paths''<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration > Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time - you need a start up script. Different operating systems and Linux distributions use different startup scripts - but here are some examples of startup scripts for different systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/upstart | Upstart script for Ubuntu based systems]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/launchd | Launchd script for OS X]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123740Universal Office Converter (unoconv)2016-05-23T08:54:31Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>{{Installing_Moodle}}<br />
==What is unoconv?==<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment activities will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with http://brew.sh/ brew.<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with http://brew.sh/ brew<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (''Site administration > Server > System paths''). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.<br />
<br />
There are some ways to get around this - one way is just to give the "_www" user write access to /Library/WebServer. <br />
<br />
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.<br />
Code to insert:<br />
<pre><br />
# Set home to a writable folder. <br />
os.environ['HOME'] = '/tmp/' <br />
</pre><br />
<br />
This needs to be inserted at line 36 immediately after the line "exitcode = 0"<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to ''Site administration > Server > System paths''<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration > Plugins > Activity modules > Assignment > Feedback plugins > Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here are some examples of startup scripts for linux systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/upstart | Upstart script for Ubuntu based systems]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/upstart&diff=123736mod/assign/feedback/editpdf/testunoconv/upstart2016-05-23T08:47:43Z<p>Damyon: Created page with "= Upstart script example for unoconv on ubuntu = Back to unoconv installation This script can be installed to /etc/init/unocon..."</p>
<hr />
<div>= Upstart script example for unoconv on ubuntu =<br />
[[ mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]<br />
<br />
This script can be installed to /etc/init/unoconv.conf and then started with the command:<br />
<pre><br />
sudo start unoconv<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
# Unoconv listener service<br />
<br />
# Install to /etc/init/ folder and start with "sudo service unoconv start"<br />
# This will start a unoconv listener and restart it if it dies. The listener<br />
# will run as the apache user "www-data" and have access to the same files/folders<br />
# as that user.<br />
# The home folder for this listener will point to /tmp/ and any temporary files used by<br />
# libreoffice will be created there.<br />
<br />
description "Unoconv Apache Listener"<br />
author "Damyon Wiese <damyon@moodle.com>"<br />
<br />
start on runlevel [2345]<br />
stop on starting rc RUNLEVEL=[016]<br />
<br />
respawn<br />
respawn limit 2 5<br />
<br />
env HOME=/tmp<br />
setuid www-data<br />
<br />
# The default of 5 seconds is too low for mysql which needs to flush buffers<br />
<br />
pre-start script<br />
# Kill any currently running soffice processes.<br />
/usr/bin/killall soffice.bin || true<br />
end script<br />
<br />
exec /usr/bin/unoconv --listener<br />
</pre><br />
<br />
[[ mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123735Universal Office Converter (unoconv)2016-05-23T08:45:30Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>{{Installing_Moodle}}<br />
=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.<br />
<br />
There are some ways to get around this - one way is just to give the "_www" user write access to /Library/WebServer. <br />
<br />
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.<br />
Code to insert:<br />
<pre><br />
# Set home to a writable folder. <br />
os.environ['HOME'] = '/tmp/' <br />
</pre><br />
<br />
This needs to be inserted at line 36 immediately after the line "exitcode = 0"<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here are some examples of startup scripts for linux systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/upstart | Upstart script for Ubuntu based systems]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Upgrading&diff=123701Upgrading2016-05-20T03:05:09Z<p>Damyon: /* Possible issues that may affect you in Moodle 3.1 */</p>
<hr />
<div>{{Installing Moodle}} <br />
''This page explains in detail how to upgrade Moodle. For a summary of the process, see [[Upgrade overview]].''<br />
<br />
==Check the requirements==<br />
<br />
Check that your server meets all requirements for 3.1 in ''Administration > Site administration > Server > [[Environment]]''. Please note that if you use MySQL you must upgrade the engine to InnoDB since it has become a requirement in Moodle 3.1. See [[Migration from MyISAM to InnoDB]].<br />
<br />
Note: You can only upgrade to Moodle 3.1 from Moodle 2.7 or later. If upgrading from earlier versions, you must [https://docs.moodle.org/27/en/Upgrading_to_Moodle_2.7 upgrade to 2.7] as a first step.<br />
<br />
==Before upgrading==<br />
<br />
'''We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.'''<br />
<br />
Consider setting the [[Upgrade key|upgrade key]] for your site.<br />
<br />
== Backup important data ==<br />
<br />
There are three areas that should be backed up before any upgrade:<br />
#Moodle software (For example, everything in server/htdocs/moodle)<br />
#Moodle uploaded files (For example, server/moodledata)<br />
#Moodle database (For example, your Postgres or MySQL database dump)<br />
<br />
See [[Site backup]] for more specific information.<br />
<br />
== Check for plugin updates ==<br />
<br />
If you have [[Automatic updates deployment]] enabled, you will be able to update installed plugins automatically during the upgrade. Just make sure you check for available updates (via the button for it) at the Plugins check screen.<br />
<br />
If you are updating plugins manually, it is a good moment now to check in the [http://moodle.org/plugins Moodle Plugins directory] whether there is a 3.1 version available for any plugins (including themes) that you have previously installed on your site. If so, download the plugin package. In the next step, you will copy it to the appropriate location in your Moodle code (see [[Installing plugins]]).<br />
<br />
The upgrade of the plugin will then happen as part of the Moodle upgrade process.<br />
<br />
If an out-of-date plugin causes your upgrade to fail, you can usually delete the plugin code rather than uninstalling it from within Moodle so that the data associated with it is not deleted.<br />
<br />
==Put your site into maintenance mode==<br />
Before you begin upgrading your site, you should put it into [[Maintenance_mode | maintenance mode]] to stop any non-admin users from logging in. Then you should wait for any currently running cron processes to complete before proceeding.<br />
<br />
== Install the new Moodle software ==<br />
You can fetch the current (3.1) version of the software through <br />
<br />
wget http://sourceforge.net/projects/moodle/files/Moodle/stable31/moodle-latest-31.tgz<br />
<br />
=== Standard install package ===<br />
<br />
# Move your old Moodle software program files to another location. ''Do NOT copy new files over the old files.''<br />
# Unzip or unpack the upgrade file so that all the new Moodle software program files are in the location the old files used to be in on the server. Moodle will adjust SQL and moodledata if it needs to in the upgrade.<br />
# Copy your old [[Configuration file|config.php file]] back to the new Moodle directory. <br />
# As mentioned above, if you had installed any plugins on your site you should add them to the new code tree (Moodle directory structure) now. It is important to check that you get the correct version for your new version of Moodle. Be particularly careful that you do not overwrite any code in the new version of Moodle and that you place the plugin folders in the correct directory (the same directory that they are in in the current installation.)<br />
# Your moodledata folder should be located separately to your Moodle code folder and, as such, should not need anything done to it. Moodle 3.0 will throw a warning if it is located in a web accessible folder and the moodledata should never be located in the Moodle code folder. If you are moving your installation to a new server or new location on your server, then you will need to follow the Migration documents.<br />
<br />
====Linux====<br />
mv moodle moodle.backup<br />
tar xvzf moodle-3.1.tgz<br />
<br />
Next, copy across your config.php, any custom plugins, and your .htaccess file if you created one ('''check that custom plugins are the correct version for your new Moodle first'''):<br />
<br />
cp moodle.backup/config.php moodle<br />
cp -pr moodle.backup/theme/mytheme moodle/theme/mytheme<br />
cp -pr moodle.backup/mod/mymod moodle/mod/mymod<br />
<br />
Don't forget to make moodle/config.php (and the rest of the source code) readable by your www server. Ideally the files should not be writeable by your server.<br />
<br />
chown -R www-data:www-data moodle (Linux debian - change to appropriate user and group for your OS version)<br />
chmod -R 755 moodle<br />
<br />
If you use cron, take care that cron.php is executeable and uses the correct php command: <br />
chmod 740 admin/cli/cron.php (some configurations need chmod 750 or chmod 755)<br />
copy the first line from cron.php (if it looks like '#!/usr/local/bin/php' or '#!/usr/local/bin/php5.3', no need to copy '<?php') <br />
if necessary. However, for a simple upgrade, there should be no need to change anything with cron.<br />
<br />
=== Using Git ===<br />
<br />
You can use Git for updating or upgrading your Moodle. See [[Git for Administrators]] for details.<br />
<br />
===Command line upgrade===<br />
<br />
On Linux servers, Moodle 3.1 supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.<br />
<br />
== Finishing the upgrade ==<br />
<br />
The last step is to trigger the upgrade processes within Moodle. <br />
<br />
If you put your site into Maintenance mode earlier; take it out now!<br />
<br />
To do this just go to ''Administration > Site administration > Notifications''.<br />
<br />
Moodle will automatically detect the new version and perform all the SQL database or file system upgrades that are necessary. If there is anything it can't do itself (very rare) then you will see messages telling you what you need to do.<br />
<br />
Assuming all goes well (no error messages) then you can start using your new version of Moodle and enjoy the new features!<br />
<br />
Note: If you are running multiple servers then you should purge all caches manually (via ''Administration > Site administration > Development > Purge all caches'') after completing the upgrade on all servers.<br />
<br />
===Fatal error: Maximum execution time of 30 seconds exceeded...===<br />
<br />
If your server uses a main language other than English, you may encounter a 'Fatal error: Maximum execution time of 30 seconds exceeded' when you try to upgrade it. You can increase max_execution_time = 160 on php.ini to allow the scripts enough time to process the language update. Otherwise, you can switch to English as the default language before doing the upgrade and back to your original language after a succcessful upgrade. See the forum discussion at https://moodle.org/mod/forum/discuss.php?d=119598.<br />
<br />
==After upgrading==<br />
<br />
The config.php file from your installation should work fine but if you take a look at config-dist.php that came with Moodle 3.0 there are more/different options available (e.g. database drivers and settings). It's a good idea to map your old config.php settings to a new one based on the 3.0 config-dist.php.<br />
<br />
===Cron===<br />
<br />
Cron has received a major update (MDL-25499) and now has support for both scheduled and ad hoc tasks.<br />
<br />
The benefits of these changes are:<br />
* The schedule for every task can be configured by the admin<br />
* Tasks can run in parallel<br />
* Cron processes use locking to prevent the same task running at the same time by different processes<br />
* Clusters with multiple identical application nodes are supported, you can run cron on all of them<br />
<br />
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner. To take advantage of the new cron system it is now strongly recommended that administrators increase the frequency that cron is run to at least ''once per minute''.<br />
<br />
You also may need to modify any automated scripts you have that are parsing the output from cron. It is no longer possible to simply monitor the output of cron for the string "Cron script completed correctly" (if that is what you were doing). An alternative is to monitor the output for the string "task failed:". If you detect that a task is failing, [[Cron#Debugging_Scheduled_Tasks|here]] are some tips for debugging the failure. <br />
<br />
Before the upgrade to 3.1, there may have been a cron task that was failing, which was preventing the rest of cron from being executed. A failure in any single task will no longer prevent the rest of the Moodle cron tasks from executing, so you may uncover previously masked bugs. It is a good idea to closely monitor the output from cron after the upgrade to 3.1.<br />
<br />
===Assignments===<br />
<br />
The old assignment (2.2) module has been removed from core and has been replaced by a stub to support transparently remapping URLs and restoring course backups from the old module to the new one. <br />
<br />
If you are still using the old assignment (2.2) module, after upgrading to Moodle 3.0 all assignment (2.2) activities will be hidden. You need to run the [[Assignment upgrade tool]] to un-hide the activities.<br />
<br />
If you really, really need to keep using the old assignment (2.2) module, you should update the code to Moodle 3.0, and then replace the "mod/assignment" folder with the one from https://github.com/moodlehq/moodle-mod_assignment/releases before completing the upgrade.<br />
<br />
==Possible issues that may affect you in Moodle 3.1==<br />
<br />
The Assignment module can now convert various office document formats to PDF to work with PDF annotations. This is optional - but it requires "unoconv" to be installed and configured on the server. See [https://docs.moodle.org/35/en/mod/assign/feedback/editpdf/testunoconv Unoconv installation].<br />
<br />
===PHP extension xmlreader requirement===<br />
As listed on the Environment page, the PHP extension xmlreader is required (in 3.1 onwards) in order for the downloading of csv, ods, excel etc files in reports and exports to stream progressively.<br />
<br />
<br />
See the [[dev:Moodle 3.1 release notes|Moodle 3.1 release notes]] for the full list of changes in Moodle 3.1.<br />
<br />
=== Moodle 2.8, 2.9 and 3.0 improvements ===<br />
<br />
Depending on which version you are upgrading from, please see the section 'Possible issues that may affect you' in the documentation<br />
<br />
* [https://docs.moodle.org/28/en/Upgrading Upgrading to Moodle 2.8]<br />
* [https://docs.moodle.org/29/en/Upgrading Upgrading to Moodle 2.9]<br />
* [https://docs.moodle.org/30/en/Upgrading Upgrading to Moodle 3.0]<br />
<br />
==See also==<br />
<br />
* [[Installation]]<br />
* Using Moodle [http://moodle.org/mod/forum/view.php?id=28 Installation help forum] <br />
* [[dev:Moodle 3.1 release notes|Moodle 3.1 release notes]]<br />
<br />
[[es:Actualización de moodle]]<br />
[[fr:Mise à jour]]<br />
[[ja:Moodleをアップグレードする]]<br />
[[de:Aktualisierung von Moodle]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123696Universal Office Converter (unoconv)2016-05-19T15:04:10Z<p>Damyon: /* Installing unoconv on OS X */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
LibreOffice needs write access to the current users home directory to create some temporary files. When unoconv is run as the webserver user (_www) it does not normally have this permission.<br />
<br />
There are some ways to get around this - one way is just to give the "_www" user write access to /Library/WebServer. <br />
<br />
Another solution is to convince LibreOffice that this users home directory is somewhere else. This can be done by inserting this code into the top of the unoconv python script.<br />
Code to insert:<br />
<pre><br />
# Set home to a writable folder. <br />
os.environ['HOME'] = '/tmp/' <br />
</pre><br />
<br />
This needs to be inserted at line 36 immediately after the line "exitcode = 0"<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123693Universal Office Converter (unoconv)2016-05-19T13:34:42Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and/or run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123689Universal Office Converter (unoconv)2016-05-19T12:17:50Z<p>Damyon: /* Installing unoconv on OS X */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
* If you are still running 14.04LTS then unoconv won't work as shipped. This might not be the most efficient route but it worked by first installing unoconv (version 0.6) from the package manager as above. You will then need to grab unoconv 0.7 from Github (https://github.com/dagwieers/unoconv), then upgrade to the latest libreoffice using the PPA (https://launchpad.net/~libreoffice/+archive/ubuntu/ppa). Point moodle at the Github version of unoconv. You need to modify the Python unoconv file by changing 'python' in the first line to 'python3'. You also need to change the permissions on the directory /var/www so that the user www-data can write to it (www-data needs to write to its home directory which it cannot do by default).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Unfortunately - newer versions of LibreOffice are not currently compatible with unoconv for mac and you will have to install LibreOffice 4.2 (Direct download link - https://downloadarchive.documentfoundation.org/libreoffice/old/4.2.5.2/mac/x86_64/LibreOffice_4.2.5.2_MacOS_x86-64.dmg).<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123673Universal Office Converter (unoconv)2016-05-19T08:42:52Z<p>Damyon: /* Installing unoconv on OS X */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac. Make sure to run it and verify it is working before continuing.<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123670Universal Office Converter (unoconv)2016-05-19T08:19:51Z<p>Damyon: /* Installing unoconv on OS X */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac<br />
<br />
Get the latest version of the unoconv python script. One way to do this is with [[http://brew.sh/ brew]].<br />
<pre><br />
brew install unoconv<br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. One way to install ghostscript is also with [[http://brew.sh/ brew]]<br />
<pre><br />
brew install ghostscript<br />
</pre><br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ). If you used brew, they will both be installed to /usr/local/bin.<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123669Universal Office Converter (unoconv)2016-05-19T08:16:35Z<p>Damyon: /* Installing unoconv on OS X */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
Download and install LibreOffice for Mac<br />
<br />
Get the latest version of the unoconv python script from here: https://github.com/dagwieers/unoconv/. Unzip it and move the unoconv binary to /usr/local/bin/unoconv.<br />
<br />
Change the first line of the unoconv script to point to the python version installed with LibreOffice. <br />
<br />
Change this:<br />
<pre><br />
</pre><br />
<br />
To this:<br />
<pre><br />
</pre><br />
<br />
If you haven't done it already - install ghostscript. The easiest way to install ghostscript is with [[http://brew.sh/ brew]]<br />
<br />
Set the paths to unoconv and ghostscript in Moodle (Site administration ▶︎ Server ▶︎ System paths ).<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123644Universal Office Converter (unoconv)2016-05-18T09:39:28Z<p>Damyon: /* Installing unoconv on Windows */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
@cd "C:\Program Files (x86)\LibreOffice 5\program"<br />
@"python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123639Universal Office Converter (unoconv)2016-05-18T07:40:38Z<p>Damyon: /* Installing unoconv on Linux */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to make a (writable) home directory for the apache user (like /home/www-data). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid, writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123638Universal Office Converter (unoconv)2016-05-18T07:38:30Z<p>Damyon: /* Installing unoconv on Linux */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to change the apache user home directory to something that does exist (like /var/www). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a valid home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123637Universal Office Converter (unoconv)2016-05-18T07:37:29Z<p>Damyon: /* Installing unoconv on Linux */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
Potential problems:<br />
* On some systems the apache user home directory is set to a non existent folder. This can cause unoconv to fail. There are 2 solutions to this - one is to change the apache user home directory to something that does exist (like /var/www). The other is to run a unoconv listener (described below) as another user other than the apache user (someone with a writable home directory).<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123636Universal Office Converter (unoconv)2016-05-18T07:28:56Z<p>Damyon: /* Installing unoconv on Windows */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Download and install LibreOffice for windows.<br />
<br />
Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Set paths in Moodle. <br />
<br />
Login as admin and go to Site administration ► Server ► System paths<br />
<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
<br />
Test ghostscript and unoconv are working correctly in the admin test pages "Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF".<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123635Universal Office Converter (unoconv)2016-05-18T07:27:05Z<p>Damyon: /* Offload processing to a different server */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Step 1. Download and install LibreOffice for windows.<br />
<br />
Step 2. Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Step 3. Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Step 4. Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Step 5. Set paths in Moodle. Login as admin and go to Site administration ► Server ► System paths<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
Step 6. Test ghostscript and unoconv are working correctly in the admin test pages Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF.<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
Install unoconv on each webservers and the remote server following the installation instructions above. <br />
<br />
Make sure unoconv is started at boot time on the remote server with the "--listener" argument and is monitored and restarted if it exits (see Debian init script for an example of how to do this). <br />
<br />
Open the firewall port 2002 between the moodle webservers and the machine running unoconv.<br />
<br />
Share the moodle data root between the webservers and the machine running unoconv. This folder must be mounted at the same path on all servers. <br />
<br />
Install a wrapper for unoconv on the webservers that forwards the requests to the remote server. Example:<br />
<pre><br />
#!/bin/bash<br />
# Wrapper script for unoconv to forward processing.<br />
# Install to /usr/bin/unoconv-remote with 755 permissions<br />
/usr/bin/unoconv --server=<ip of remote server> "$@"<br />
</pre><br />
<br />
Configure the path to unoconv in the Moodle admin settings to point to this wrapper script.<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123634Universal Office Converter (unoconv)2016-05-18T07:11:50Z<p>Damyon: /* Installing unoconv on Windows */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Step 1. Download and install LibreOffice for windows.<br />
<br />
Step 2. Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
<br />
Step 3. Rename the downloaded script to C:\unoconv\unoconv.py<br />
<br />
Step 4. Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
Step 5. Set paths in Moodle. Login as admin and go to Site administration ► Server ► System paths<br />
Set pathtogs setting to your ghostscript installation binary, (C:\gs\bin\gswin32.exe)<br />
Set pathtounoconv to the batch file created above (C:\unoconv\unoconv.bat)<br />
Step 6. Test ghostscript and unoconv are working correctly in the admin test pages Site administration ► Plugins ► Activity modules ► Assignment ► Feedback plugins ► Annotate PDF.<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123633Universal Office Converter (unoconv)2016-05-18T06:56:36Z<p>Damyon: /* Installing unoconv on Windows */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
Step 1. Download and install LibreOffice for windows.<br />
Step 2. Download the latest version of the unoconv script from https://github.com/dagwieers/unoconv/releases. <br />
Step 3. Rename the downloaded script to C:\unoconv\unoconv.py<br />
Step 4. Create a batch file C:\unoconv\unoconv.bat with these contents:<br />
<pre><br />
echo off<br />
cd "C:\unoconv"<br />
"C:\Program Files\LibreOffice 5\program\python-core-3.3.0\bin\python.exe" unoconv.py %* <br />
</pre><br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123632mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:39:57Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
[[ mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]<br />
<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes. This version will print a message when unoconv is restarted so that an email will be sent by cron.<br />
<pre><br />
*/5 * * * * /usr/bin/service unoconvd status > /dev/null || (/usr/bin/service unoconvd start && echo "Restarted crashed unoconv listener")<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
[[ mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123631mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:39:22Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
[[ mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]<br />
<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes. This version will print a message when unoconv is restarted so that an email will be sent by cron.<br />
<pre><br />
*/5 * * * * /usr/bin/service unoconvd status > /dev/null || (/usr/bin/service unoconvd start && echo "Restarted crashed unoconv listener")<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123630mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:38:52Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
[[ /mod/assign/feedback/editpdf/testunoconv | Back to unoconv installation ]]<br />
<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes. This version will print a message when unoconv is restarted so that an email will be sent by cron.<br />
<pre><br />
*/5 * * * * /usr/bin/service unoconvd status > /dev/null || (/usr/bin/service unoconvd start && echo "Restarted crashed unoconv listener")<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123629mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:38:28Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
[[ mod/assign/feedback/editpdf/testunoconv/ | Back to unoconv installation ]]<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes. This version will print a message when unoconv is restarted so that an email will be sent by cron.<br />
<pre><br />
*/5 * * * * /usr/bin/service unoconvd status > /dev/null || (/usr/bin/service unoconvd start && echo "Restarted crashed unoconv listener")<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123628mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:35:04Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes. This version will print a message when unoconv is restarted so that an email will be sent by cron.<br />
<pre><br />
*/5 * * * * /usr/bin/service unoconvd status > /dev/null || (/usr/bin/service unoconvd start && echo "Restarted crashed unoconv listener")<br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123627mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:26:09Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<br />
This script can be installed to /etc/init.d/unoconvd and then linked to system startup with the command:<br />
<pre><br />
sudo update-rc.d unoconvd defaults<br />
</pre><br />
<br />
It is also recommended to add this to the root crontab as it is safe to run "sudo service unoconvd start" over and over (it will check if the process is running and start it if required). <br />
<br />
Crontab entry to check and start the process every 5 minutes.<br />
<pre><br />
*/5 * * * * service unoconvd start <br />
</pre><br />
<br />
Here is the script.<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123626mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:20:52Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Startup script for unoconvd listener<br />
# Description: Startup script for unoconvd listener. Allows starting/stopping/restarting and checking status of unoconvd listener.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123625mod/assign/feedback/editpdf/testunoconv/initd2016-05-18T06:18:29Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Example initscript<br />
# Description: This file should be used to construct scripts to be<br />
# placed in /etc/init.d.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
#<br />
# Please remove the "Author" lines above and replace them<br />
# with your own name if you copy and modify this script.<br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
status_of_proc "$DAEMON" "$NAME" > /dev/null<br />
RETVAL="$?"<br />
[ "$RETVAL" = 3 ] && start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre><br />
<br />
<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv/initd]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123624Universal Office Converter (unoconv)2016-05-18T06:18:05Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123623Universal Office Converter (unoconv)2016-05-18T06:15:54Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[File:unoconvd]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123622Universal Office Converter (unoconv)2016-05-18T06:14:15Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[:File:unoconvd]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123619Universal Office Converter (unoconv)2016-05-18T05:59:36Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv utilises a client/server process when converting documents. By default, when there is no running server process - each time unoconv runs it will start a server process, send it's request and shutdown the server process when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server process when the second request is still in progress - and the second conversion request fails. A more robust way to configure unoconv is to start a server process at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}<br />
<br />
[[es:mod/assign/feedback/editpdf/testunoconv]]</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123580Universal Office Converter (unoconv)2016-05-17T09:27:10Z<p>Damyon: /* Installing unoconv on Linux */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<br />
<pre><br />
apt-get install unoconv<br />
</pre><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123579mod/assign/feedback/editpdf/testunoconv/initd2016-05-17T09:24:32Z<p>Damyon: /* Init script example for unoconv on debian */</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<pre><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Example initscript<br />
# Description: This file should be used to construct scripts to be<br />
# placed in /etc/init.d.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
#<br />
# Please remove the "Author" lines above and replace them<br />
# with your own name if you copy and modify this script.<br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</pre></div>Damyonhttps://docs.moodle.org/35/en/index.php?title=mod/assign/feedback/editpdf/testunoconv/initd&diff=123578mod/assign/feedback/editpdf/testunoconv/initd2016-05-17T09:24:03Z<p>Damyon: Created page with "= Init script example for unoconv on debian = <code> #! /bin/sh ### BEGIN INIT INFO # Provides: unoconvd # Required-Start: $remote_fs $syslog # Required-Stop:..."</p>
<hr />
<div>= Init script example for unoconv on debian =<br />
<code><br />
#! /bin/sh<br />
### BEGIN INIT INFO<br />
# Provides: unoconvd<br />
# Required-Start: $remote_fs $syslog<br />
# Required-Stop: $remote_fs $syslog<br />
# Default-Start: 2 3 4 5<br />
# Default-Stop: 0 1 6<br />
# Short-Description: Example initscript<br />
# Description: This file should be used to construct scripts to be<br />
# placed in /etc/init.d.<br />
### END INIT INFO<br />
<br />
# Author: Damyon Wiese <damyon@moodle.com><br />
#<br />
# Please remove the "Author" lines above and replace them<br />
# with your own name if you copy and modify this script.<br />
<br />
# Do NOT "set -e"<br />
<br />
# PATH should only include /usr/* if it runs after the mountnfs.sh script<br />
PATH=/sbin:/usr/sbin:/bin:/usr/bin<br />
DESC="Unoconv listener for document conversions"<br />
NAME=unoconv<br />
DAEMON=/usr/bin/$NAME<br />
DAEMON_ARGS="--listener"<br />
PIDFILE=/var/run/$NAME.pid<br />
SCRIPTNAME=/etc/init.d/$NAME<br />
APACHEUSER=www-data<br />
<br />
# Exit if the package is not installed<br />
[ -x "$DAEMON" ] || exit 0<br />
<br />
# Read configuration variable file if it is present<br />
[ -r /etc/default/$NAME ] && . /etc/default/$NAME<br />
<br />
# Load the VERBOSE setting and other rcS variables<br />
. /lib/init/vars.sh<br />
<br />
# Define LSB log_* functions.<br />
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present<br />
# and status_of_proc is working.<br />
. /lib/lsb/init-functions<br />
<br />
#<br />
# Function that starts the daemon/service<br />
#<br />
do_start()<br />
{<br />
# Return<br />
# 0 if daemon has been started<br />
# 1 if daemon was already running<br />
# 2 if daemon could not be started<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER --test > /dev/null \<br />
|| return 1<br />
start-stop-daemon --start --quiet --make-pidfile --background --pidfile $PIDFILE --exec $DAEMON --chuid $APACHEUSER -- \<br />
$DAEMON_ARGS \<br />
|| return 2<br />
# Add code here, if necessary, that waits for the process to be ready<br />
# to handle requests from services started subsequently which depend<br />
# on this one. As a last resort, sleep for some time.<br />
}<br />
<br />
#<br />
# Function that stops the daemon/service<br />
#<br />
do_stop()<br />
{<br />
# Return<br />
# 0 if daemon has been stopped<br />
# 1 if daemon was already stopped<br />
# 2 if daemon could not be stopped<br />
# other if a failure occurred<br />
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME<br />
RETVAL="$?"<br />
[ "$RETVAL" = 2 ] && return 2<br />
# Wait for children to finish too if this is a daemon that forks<br />
# and if the daemon is only ever run from this initscript.<br />
# If the above conditions are not satisfied then add some other code<br />
# that waits for the process to drop all resources that could be<br />
# needed by services started subsequently. A last resort is to<br />
# sleep for some time.<br />
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON<br />
[ "$?" = 2 ] && return 2<br />
# Many daemons don't delete their pidfiles when they exit.<br />
rm -f $PIDFILE<br />
<br />
/usr/bin/killall /usr/lib/libreoffice/program/soffice.bin<br />
<br />
return "$RETVAL"<br />
}<br />
<br />
#<br />
# Function that sends a SIGHUP to the daemon/service<br />
#<br />
do_reload() {<br />
#<br />
# If the daemon can reload its configuration without<br />
# restarting (for example, when it is sent a SIGHUP),<br />
# then implement that here.<br />
#<br />
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME<br />
return 0<br />
}<br />
<br />
case "$1" in<br />
start)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"<br />
do_start<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
stop)<br />
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;<br />
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;<br />
esac<br />
;;<br />
status)<br />
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?<br />
;;<br />
#reload|force-reload)<br />
#<br />
# If do_reload() is not implemented then leave this commented out<br />
# and leave 'force-reload' as an alias for 'restart'.<br />
#<br />
#log_daemon_msg "Reloading $DESC" "$NAME"<br />
#do_reload<br />
#log_end_msg $?<br />
#;;<br />
restart|force-reload)<br />
#<br />
# If the "reload" option is implemented then remove the<br />
# 'force-reload' alias<br />
#<br />
log_daemon_msg "Restarting $DESC" "$NAME"<br />
do_stop<br />
case "$?" in<br />
0|1)<br />
do_start<br />
case "$?" in<br />
0) log_end_msg 0 ;;<br />
1) log_end_msg 1 ;; # Old process is still running<br />
*) log_end_msg 1 ;; # Failed to start<br />
esac<br />
;;<br />
*)<br />
# Failed to stop<br />
log_end_msg 1<br />
;;<br />
esac<br />
;;<br />
*)<br />
#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2<br />
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2<br />
exit 3<br />
;;<br />
esac<br />
<br />
:<br />
</code></div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123577Universal Office Converter (unoconv)2016-05-17T09:23:26Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd | Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123576Universal Office Converter (unoconv)2016-05-17T09:22:56Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[[mod/assign/feedback/editpdf/testunoconv/initd Init script for Debian]]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123575Universal Office Converter (unoconv)2016-05-17T09:22:28Z<p>Damyon: /* Run a unoconv listener */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
To start a unoconv listener at boot time on linux - you need a start up script. Different linux distributions use different startup scripts - but here is an example of an init.d script for debian systems.<br />
<br />
[mod/assign/feedback/editpdf/testunoconv/initd Init script for Debian]<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123570Universal Office Converter (unoconv)2016-05-17T08:43:02Z<p>Damyon: /* Additional Resources */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
...<br />
<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123567Universal Office Converter (unoconv)2016-05-17T08:30:41Z<p>Damyon: /* Additional Resources */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
...<br />
<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips when it is not working.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyonhttps://docs.moodle.org/35/en/index.php?title=Universal_Office_Converter_(unoconv)&diff=123566Universal Office Converter (unoconv)2016-05-17T08:30:27Z<p>Damyon: /* Offload processing to a different server */</p>
<hr />
<div>=Installing unoconv=<br />
<br />
"unoconv" is a command line program that is used to convert between different office document file formats. It uses an instance of [http://libreoffice.org LibreOffice] to do the conversion and is used by the assignment module to convert documents to pdf so that they can be annotated. If unoconv is not installed - the only impact is that the assignment module will only allow annotations when students upload a pdf document. <br />
<br />
The steps required to install unoconv are different depending on the operating system that you have installed Moodle on. <br />
<br />
== Installing unoconv on Linux ==<br />
The required version of unoconv is at least 0.7. Depending on your flavour of linux, this may be available in your package manager and you can install it directly with:<br />
<br />
(Ubuntu 16.04 LTS)<br />
<code><br />
apt-get install unoconv<br />
</code><br />
<br />
If your package manager contains an older version of the package, you will have to find a newer version and install it manually ([https://packages.debian.org/stretch/unoconv Debian Testing]). Unoconv itself is just a python script, so it has few dependencies.<br />
<br />
== Installing unoconv on OS X ==<br />
...<br />
<br />
== Installing unoconv on Windows ==<br />
...<br />
<br />
== Run a unoconv listener ==<br />
unoconv uses a client/server when processing documents. By default, when there is no running server - each time unoconv runs it will start a server, send it's request and shutdown the server when the request is complete. The drawback of this mode is that if 2 requests are submitted simultaneously - this can cause the first request to shutdown the server when the second request is still processing - and the second conversion request fails. A more robust way to install unoconv is to start a server at boot time, and run a script to monitor it and restart it if it crashes.<br />
<br />
...<br />
<br />
<br />
== Offload processing to a different server ==<br />
Processing office documents can put increased load on your webserver, which may impact on the responsiveness of your site. If you are installing unoconv on a large site you may want to consider running unoconv on a server that is not also serving web requests.<br />
<br />
How to do this:<br />
<br />
...<br />
<br />
==Additional Resources==<br />
The unoconv [https://github.com/dagwieers/unoconv documentation] site has additional information on installation of unoconv and troubleshooting tips when it is not working right.<br />
<br />
[[Category:Site administration]]<br />
{{Installing_Moodle}}</div>Damyon