From fb60133713949c9711c6ba47813d39e35ccd3e51 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Sun, 23 Sep 2018 07:50:04 +0300 Subject: [PATCH] Add example systemd unit for statistics API --- contrib/cgspace-statistics-api.service | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 contrib/cgspace-statistics-api.service diff --git a/contrib/cgspace-statistics-api.service b/contrib/cgspace-statistics-api.service new file mode 100644 index 0000000..ec60a81 --- /dev/null +++ b/contrib/cgspace-statistics-api.service @@ -0,0 +1,18 @@ +[Unit] +Description=CGSpace Statistics API +After=network.target + +[Service] +Environment=SOLR_SERVER=http://localhost:8081/solr +Environment=SOLR_CORE=statistics +User=nobody +Group=nogroup +WorkingDirectory=/opt/ilri/cgspace-statistics-api +ExecStart=/opt/ilri/cgspace-statistics-api/venv/bin/gunicorn \ + --bind 127.0.0.1:5000 \ + app:api +ExecReload=/bin/kill -s HUP $MAINPID +ExecStop=/bin/kill -s TERM $MAINPID + +[Install] +WantedBy=multi-user.target