I've setup and configured Apache Superset, but I can't get it to run as a Systemd Service.

I've tried setting it up in a virtualenv and using systemd like this, but I still get an error about gunicorn not being available and the unit fails to start.

I've also tried creating a separate user for Superset, installing Superset and its dependencies with pip install --user, the unit then looks like:

After=syslog.target network.target

ExecStart=/home/superset/.local/bin/superset runserver


and it still doesn't work. Looking at the journal

Jul 13 22:54:21 radioactive-man systemd[1]: Started Superset.
Jul 13 22:54:23 radioactive-man superset[24023]: 2018-07-13 22:54:23,893:INFO:root:The Gunicorn 'superset runserver' command is deprecated. Please use the 'gunicorn' command instead.
Jul 13 22:54:23 radioactive-man superset[24023]: /bin/sh: 1: gunicorn: not found
Jul 13 22:54:23 radioactive-man superset[24023]: Starting server with command:
Jul 13 22:54:23 radioactive-man superset[24023]: gunicorn -w 2 --timeout 60 -b --limit-request-line 0 --limit-request-field_size 0 superset:app
Jul 13 22:54:23 radioactive-man superset[24023]:

running the command at bash it works fine.

Environment Info

Ubuntu Linux 16.04

Superset 0.26.3

1 Answer 1


Most of the times when a file exists on your system and you get an Error message stating it wasn't found this means the OS doesn't find the file in you $PATH environment variable.

The easiest way to make your OS find gunicorn is to put gunicorn under /usr/local/bin, something that is in the default path.

Adding its location to your path will only be taken into account by your active session, once you close it, it will be gone, unless you put it in /etc/environment file and reboot.

You can also configure the service environment:

  • Create a directory under /etc/systemd/system/<service_name>.service.d
  • Create a file under the newly created directory and configure the service environment like below:

    $ vim /etc/systemd/system/<service_name>.service.d/file.conf


Note: Since The file we added is no shell script, it doesn t support variable expansion

writing PATH=$PATH:/path_to_directory_containing_gunicorn WILL NOT WORK As expected

  • reload the units configuration

    $ systemctl daemon-reload
  • Thanks! That's a super detailed answer. I actually just symlinked gunicorn to /usr/local/bin and it worked.
    – aphid
    Jul 15, 2018 at 0:47
  • 1
    I should note that Environment= does not expand variables in assignments. "The $ character has no special meaning." Jul 20, 2018 at 5:22
  • @grawity Thank you for comment, i will check it and update accordingly
    – Ezwig
    Jul 20, 2018 at 8:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .