title: Airflow Worker Daemon exits for no visible reason
body: <p>I have Airflow 1.9 running inside a virtual environment, set up with Celery and Redis and it works well. However, I wanted to daemon-ize the set up and used the instructions <a href="https://medium.com/@vando/airflow-inside-a-virtual-enviroment-and-integrated-with-systemd-3b6427bd6430" rel="nofollow noreferrer">here</a>. It works well for the Webserver, Scheduler and Flower, but fails for the Worker, which is of course, the core of it all. My <code>airflow-worker.service</code> file looks like this:</p>
  
  <pre><code>[Unit]
  Description=Airflow celery worker daemon
  After=network.target postgresql.service mysql.service redis.service rabbitmq-server.service
  Wants=postgresql.service mysql.service redis.service rabbitmq-server.service
  
  [Service]
  EnvironmentFile=/etc/default/airflow
  User=root
  Group=root
  Type=simple
  ExecStart=/bin/bash -c 'source /home/codingincircles/airflow-master/bin/activate ; airflow worker'
  Restart=on-failure
  RestartSec=10s
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>Curiously, if I run the <code>ExecStart</code> command on the CLI as is, it runs perfectly and tasks run and everything is glorious. However, when I do a <code>sudo service airflow-worker start</code>, it takes a while to return to prompt and nothing shows up in the Flower UI. When I do <code>journalctl -u airflow-worker.service -e</code>, this is what I see:</p>
  
  <pre><code>systemd[1]: Started Airflow celery worker daemon.
  bash[12392]: [2018-04-09 21:52:41,202] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/Grammar.txt
  bash[12392]: [2018-04-09 21:52:41,252] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.5/lib2to3/PatternGrammar.txt
  bash[12392]: [2018-04-09 21:52:41,578] {configuration.py:206} WARNING - section/key [celery/celery_ssl_active] not found in config
  bash[12392]: [2018-04-09 21:52:41,578] {default_celery.py:41} WARNING - Celery Executor will run without SSL
  bash[12392]: [2018-04-09 21:52:41,579] {__init__.py:45} INFO - Using executor CeleryExecutor
  systemd[1]: airflow-worker.service: Main process exited, code=exited, status=1/FAILURE
  systemd[1]: airflow-worker.service: Unit entered failed state.
  systemd[1]: airflow-worker.service: Failed with result 'exit-code'.
  </code></pre>
  
  <p>What am I doing wrong? Any other method of using Airflow works, except when I try to daemon-ize it. Even using the <code>-D</code> flag after the <code>airflow</code> commands works (like <code>airflow worker -D</code>), except I'm not sure if that is the right/safe/recommended way of using it in production and would rather make it a service and use it. Please help.</p>