The MediaGoblin WSGI application instance you get with ``./lazyserver.sh`` is
not ideal for a production MediaGoblin deployment. Ideally, you should be able
-to use a systemd service file or an init script to launch and restart the
+to use a Systemd service file or an init script to launch and restart the
MediaGoblin process.
-We will explore setting up MediaGoblin systemd service files and init scripts,
+We will explore setting up MediaGoblin Systemd service files and init scripts,
but first we need to create the directory that will store the MediaGoblin logs.
.. _systemd-service-files:
-Use systemd service files
+Use Systemd service files
-------------------------
-If your operating system uses systemd, you can use systemd ``service files``
+If your operating system uses Systemd, you can use Systemd ``service files``
to manage both the Celery and Paste processes. Place the following service
files in the ``/etc/systemd/system/`` directory.
# If using Fedora/CentOS/Red Hat, mkdir and chown are located in /usr/bin/mkdir and /usr/bin/chown, respectively.
[Unit]
- Description=Mediagoblin Celeryd
+ Description=MediaGoblin Celeryd
[Service]
User=mediagoblin
ExecStartPre=/bin/mkdir -p /run/mediagoblin
ExecStartPre=/bin/chown -hR mediagoblin:mediagoblin /run/mediagoblin
# Celery process will run as the `mediagoblin` user after start.
- Environment=MEDIAGOBLIN_CONFIG=/srv/mediagoblin.example.org/mediagoblin/mediagoblin_local.ini \
+ Environment=MEDIAGOBLIN_CONFIG=/srv/mediagoblin.example.org/mediagoblin/mediagoblin.ini \
CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery
ExecStart=/srv/mediagoblin.example.org/mediagoblin/bin/celery worker \
--logfile=/var/log/mediagoblin/celery.log \
--pid-file=/var/run/mediagoblin/mediagoblin.pid \
--log-file=/var/log/mediagoblin/mediagoblin.log \
--daemon \
- --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
+ --server-name=main
ExecStop=/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \
--pid-file=/var/run/mediagoblin/mediagoblin.pid \
/srv/mediagoblin.example.org/mediagoblin/paste_local.ini stop
Use an init script
------------------
-If your system does not use systemd, you can use the following command as the
+If your system does not use Systemd, you can use the following command as the
basis for an init script:
.. code-block:: bash
/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \
/srv/mediagoblin.example.org/mediagoblin/paste.ini \
--pid-file=/var/run/mediagoblin.pid \
- --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
+ --server-name=main
The above configuration places MediaGoblin in "always eager" mode
with Celery, this means that submissions of content will be processed
/srv/mediagoblin.example.org/mediagoblin/bin/paster serve \
/srv/mediagoblin.example.org/mediagoblin/paste.ini \
--pid-file=/var/run/mediagoblin.pid \
- --server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
+ --server-name=main
Members of the MediaGoblin community have provided init scripts for the
CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_celery ./bin/celeryd
-If you use our example systemd ``service files``, Celery will be set to the
+If you use our example Systemd ``service files``, Celery will be set to the
"CELERY_ALWAYS_EAGER=false" value by default. This will provide your users
with the best user experience, as all media processing will be done in the
background.