zl程序教程

您现在的位置是:首页 >  其它

当前栏目

systemd 运行celery

运行 systemd Celery
2023-06-13 09:17:14 时间

However, the init.d script should still work in those Linux distributions as well since systemd provides the systemd-sysv compatiblity layer which generates services automatically from the init.d scripts we provide.

官网已经有了相关的教程http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#usage-systemd, 但是在实际操作的时候发现按照教程来配置无法正常启动。会报错,于是把服务简化了一下,把配置和服务信息写到了一起。如果你也遇到这个问题可以尝试下面的简化脚本:

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

[Service]
WorkingDirectory=/var/www/html
ExecStart=/usr/local/bin/celery -A proj worker --logfile=/var/log/celery/celery.log  --loglevel="INFO"

Restart=on-failure

#3秒后启动
RestartSec=3s

[Install]
WantedBy=multi-user.target

系统Ubuntu 18.04, systemd版本:

root@mars:/etc/systemd/system# systemctl --version
systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP 
+GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

☆文章版权声明☆

* 网站名称:obaby@mars * 网址:https://h4ck.org.cn/ * 本文标题: 《systemd 运行celery》 * 本文链接:https://h4ck.org.cn/2019/04/systemd-%e8%bf%90%e8%a1%8ccelery/ * 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


分享文章:

相关文章:

  1. ubuntu 16.04 uwsgi自启动
  2. 再谈《Django 限制访问频率》
  3. Django 限制访问频率
  4. 由apscheduler引发的django.db.utils.InternalError: (1054, u”Unknown column ‘rms.go_datetime’ in ‘field list'”)
  5. Lanhelper 1.93 【Cracked】破解版
  6. ubuntu uwsgi No module named ‘django’
  7. django 1452, ‘Cannot add or update a child row: a foreign key constraint fails
  8. 如何绕过微信图片的防盗链
  9. ngix+uwsgi+django 以及阿里云rds数据库数据导入
  10. django 主动抛出 403 异常