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) 》许可协议。
分享文章:
相关文章:
- ubuntu 16.04 uwsgi自启动
- 再谈《Django 限制访问频率》
- Django 限制访问频率
- 由apscheduler引发的django.db.utils.InternalError: (1054, u”Unknown column ‘rms.go_datetime’ in ‘field list'”)
- Lanhelper 1.93 【Cracked】破解版
- ubuntu uwsgi No module named ‘django’
- django 1452, ‘Cannot add or update a child row: a foreign key constraint fails
- 如何绕过微信图片的防盗链
- ngix+uwsgi+django 以及阿里云rds数据库数据导入
- django 主动抛出 403 异常
相关文章
- 关于window10安装jdk,配置环境变量,javac不是内部或外部命令,也不是可运行的程序 或批处理文件的细节问题。[通俗易懂]
- Android 天气APP(三十六)运行到本地AS、更新项目版本依赖、去掉ButterKnife
- 如何配置IIS运行 ASPX
- MySQL编译安装:从源码到运行(源码编译安装mysql)
- 性能Linux优化:让系统运行更加高效(linux优化系统)
- MySQL启动工具:轻松运行数据库(mysql启动工具)
- Linux看门狗驱动:保障系统稳定运行(linux看门狗驱动)
- 基于SqlServer云主机的稳定运行实践(sqlserver云主机)
- 64位系统运行32位MySQL的技术实现(64位系统32mysql)
- MySQL指令在CMD中运行掌握逆天小括号(cmd小括号 mysql)
- 为Redis加大连接数量,打造高效运行环境(redis配置大连接数)
- 深入分析在Python模块顶层运行的代码引起的一个Bug
- C#在运行时动态创建类型的实现方法