[Unit]
Description=Celery Service
After=network.target

[Service]
Type=forking
User=$WHYIS_USER
Group=$WHYIS_GROUP
EnvironmentFile=/etc/conf.d/celery
WorkingDirectory=$WHYIS_APP_HOME
ExecStart=/bin/sh -c '${CELERY_BIN} -A ${CELERY_APP} multi start ${CELERYD_NODES} \
		  --pidfile=${CELERYD_PID_FILE} --logfile=${CELERYD_LOG_FILE} \
		  --loglevel="${CELERYD_LOG_LEVEL}" ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
		 --pidfile=${CELERYD_PID_FILE} --loglevel="${CELERYD_LOG_LEVEL}"'
ExecReload=/bin/sh -c '${CELERY_BIN} -A ${CELERY_APP} multi restart ${CELERYD_NODES} \
		   --pidfile=${CELERYD_PID_FILE} --logfile=${CELERYD_LOG_FILE} \
		   --loglevel="${CELERYD_LOG_LEVEL}" ${CELERYD_OPTS}'
Restart=always

[Install]
WantedBy=multi-user.target