Airflow inside a virtual enviroment and integrated with systemd

I installed Airflow from pip inside a virtual enviroment because I didn’t want to contaminate my entirely OS. Also, I needed to start/stop Airflow as a normal daemon. Airflow has integration with systemd and it looks simple if you installed Airflow globally.

Before my non-elegant solution I tried to use Environment variable but it didn’t work. Systemd requires absolute path to execute commands.

(If you want to manage systemd see this article or save your time reading this cheatsheet.)

These are the files to get Airflow working throught systemd: The Airflow Flower service

Keep in mind that these files are configured for CentOS. If you install them in Debian, replace the EnviromentFile variable and modify path to Bash in ExecStart.