-
David Schmitz authored
celery lock file cleanup actions at startup: move these actions to own python file to be explicitly run before starting celery (in systemd service file), as otherwise the code is not only executed on startup of celery, but just by loading flowspy.celery which happens, e.g., in each gunicorn worker process
David Schmitz authoredcelery lock file cleanup actions at startup: move these actions to own python file to be explicitly run before starting celery (in systemd service file), as otherwise the code is not only executed on startup of celery, but just by loading flowspy.celery which happens, e.g., in each gunicorn worker process
fod-celeryd.service.dist 1.01 KiB
[Unit]
Description=Firewall-On-Demand (FoD) celeryd (back-end)
#After=network.target auditd.service
Requires=fod-gunicorn.service redis-server.service
OnFailure=fod-status-email-user@%n.service
[Service]
#Type=forking
Type=simple
User=fod
WorkingDirectory=/srv/flowspy
#RuntimeDirectory=yourservice
#RuntimeDirectoryMode=0755
ExecStartPre=-/bin/mkdir -p /var/run/fod/
ExecStartPre=-/bin/chown fod: /var/run/fod/
ExecStartPre=-/bin/rm -f -r /var/run/fod/snmppoll.lock
ExecStartPre=-/bin/rm -f /srv/flowspy/snmp_temp_data.lock
ExecStartPre=-/srv/flowspy/flowspy/run_celery_preactions
#ExecStart=/srv/flowspy/pythonenv celery -A flowspy worker -B --concurrency=2 -l debug -f /srv/flowspy/log/celery.log
ExecStart=/srv/flowspy/pythonenv celery -A flowspy worker -B --concurrency=2 -l info -f /srv/flowspy/log/celery.log
#PIDFile=/tmp/yourservice.pid
StandardOutput=append:/srv/flowspy/log/celeryd-stdout.log
StandardError=append:/srv/flowspy/log/celeryd-stderr.log
Restart=on-failure
###
[Install]
WantedBy=multi-user.target