aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mediagoblin/templates/etc_systemd_system_mediagoblin-paster.service.j2
blob: 63a589d1ce734c185ee8ab94c885164947aec4b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Set the WorkingDirectory, Environment and ExecStart values to match your environment.
# If using Debian/*buntu, mkdir and chown are located in /bin/mkdir and /bin/chown, respectively.
# If using Fedora/CentOS/Red Hat, mkdir and chown are located in /usr/bin/mkdir and /usr/bin/chown, respectively.
[Unit]
Description=Mediagoblin

[Service]
Type=forking
User=mediagoblin
Group=mediagoblin
Environment=CELERY_ALWAYS_EAGER=false
WorkingDirectory={{ mediagoblin_basedir }}/src
# Start mg-paster process as root, then switch to mediagoblin user/group
PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir -p /run/mediagoblin
ExecStartPre=/bin/chown -hR mediagoblin:mediagoblin /run/mediagoblin

ExecStart={{ mediagoblin_basedir }}/src/bin/paster serve \
              {{ mediagoblin_basedir }}/src/paste_local.ini \
              --pid-file=/var/run/mediagoblin/mediagoblin.pid \
              --log-file=/var/log/mediagoblin/mediagoblin.log \
              --daemon \
              --server-name=http http_host=127.0.0.1 http_port=26543
              #--server-name=fcgi fcgi_host=127.0.0.1 fcgi_port=26543
ExecStop={{ mediagoblin_basedir }}/src/bin/paster serve \
             --pid-file=/var/run/mediagoblin/mediagoblin.pid \
             {{ mediagoblin_basedir }}/src/paste_local.ini stop
PIDFile=/var/run/mediagoblin/mediagoblin.pid

[Install]
WantedBy=multi-user.target