设置gunicorn与systemd一起运行

2024-01-20

正在尝试设置gunicorn与一起运行systemd。控制文件是/etc/systemd/system/gunicorn.service测试的输出是

root@samuel-pc:~# systemctl start gunicorn
Failed to start gunicorn.service: Unit gunicorn.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status gunicorn.service' for details.


root@samuel-pc:~# systemctl status gunicorn.service
● gunicorn.service - gunicorn daemon
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)

Jun 29 05:13:17 samuel-pc systemd[1]: [/etc/systemd/system/gunicorn.service:9] Executable path is not absolute, ignoring: gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp
Jun 29 05:13:17 samuel-pc systemd[1]: gunicorn.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 29 05:13:29 samuel-pc systemd[1]: [/etc/systemd/system/gunicorn.service:9] Executable path is not absolute, ignoring: gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp
Jun 29 05:13:29 samuel-pc systemd[1]: gunicorn.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 29 05:15:45 samuel-pc systemd[1]: [/etc/systemd/system/gunicorn.service:9] Executable path is not absolute, ignoring: gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp
Jun 29 05:15:45 samuel-pc systemd[1]: gunicorn.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 29 07:01:10 samuel-pc systemd[1]: [/etc/systemd/system/gunicorn.service:9] Executable path is not absolute, ignoring: gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp
Jun 29 07:01:10 samuel-pc systemd[1]: gunicorn.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Jun 29 07:01:55 samuel-pc systemd[1]: [/etc/systemd/system/gunicorn.service:9] Executable path is not absolute, ignoring: gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp
Jun 29 07:01:55 samuel-pc systemd[1]: gunicorn.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

这表明错误从gunicorn服务的第9行开始,因为ExecStart

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=root
Group=www-data
WorkingDirectory=/root/revamp
ExecStart=gunicorn --access-logfile - --workers 3 --bind unix:/root/revamp/revamp.sock revamp.wsgi:application


[Install]
WantedBy=multi-user.target

它告诉您它不需要相对路径gunicorn可执行文件:
Executable path is not absolute, ignoring.

您需要将其更改为您的绝对路径gunicorn可执行文件,或者:

  • 系统可执行文件:ExecStart=/usr/local/bin/gunicorn
  • 您的虚拟环境的可执行文件:ExecStart=/path/to/venv/bin/gunicorn

你可以检查这个要点:使用 Systemd 确保 Gunicorn 在引导时启动 https://gist.github.com/marcanuy/5ae0e0ef5976aa4a10a7,用于最小的 Gunicorn systemd 服务配置文件。

希望这可以帮助!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

设置gunicorn与systemd一起运行 的相关文章

随机推荐

  • 用 for 循环替换 if 语句 (Java)

    我正在开发一个项目 收到的评论之一是我的 if 语句太长 我同意这一点 但我仍然很困惑如何用建议的 for 循环替换它 它一直让我发疯 该项目是分析句子中的辅音并报告它们是否在其中 这是我使用的代码 该项目已经被标记 所以这更像是一个 我的
  • 序列化类时出现 Stackoverflow 异常

    我有一棵树 想将它们序列化为 xml 这些节点派生自 Nodebase 类 我认为是在此处找到的 该类在序列化时失败 public class NodeBase IEqualityComparer IEnumerable IEnumerab
  • Python/AWS Lambda 函数:如何查看 /tmp 存储?

    Lambda 函数可以访问自己的磁盘空间 tmp目录 我的问题是 我在哪里可以直观地看到 tmp目录 我正在尝试将文件下载到 tmp目录来读取它们 并向其中写入一个新文件 我实际上希望看到我正在处理的文件是否正确存储在 tmp执行期间 谢谢
  • 目前 WPF 最好的空闲时间选择器是什么?

    我正在寻找一个简单的时间选择器WPF 的控件 我找到了这个 http marlongrech wordpress com 2007 11 18 time picker http marlongrech wordpress com 2007
  • Laravel 社交名流的名字和姓氏

    我正在使用 Laravel 的 Socialite 将社交身份验证添加到应用程序中 我可以检索全名 但不能分别检索名字和姓氏 回调发生且社交名流处理后 用户已成功检索 如果我要转储我从中恢复的用户 user this gt social g
  • 为arm64构建OpenSSL FIPS

    我找到了为arm64构建非FIPS openssl的参考 但我需要构建FIPS版本 项目如https github com GotoHack iOS openSSL FIPS https github com GotoHack iOS op
  • 运算符不存在:json = json

    当我尝试从表中选择一些记录时 SELECT FROM movie test WHERE tags dramatic women political json sql代码抛出错误 LINE 1 SELECT FROM movie test W
  • 通过注释抑制 IntelliJ IDEA 中的重复警告

    从版本 15 开始 IntelliJ 警告我有关代码重复的问题 https www jetbrains com help idea 2016 1 analyzing duplicates html origin old help 在某些情况
  • 如何在android中点击按钮打开下面的自定义布局对话框?

    我想在点击按钮下方创建下拉自定义对话框 单击计数器按钮 布局将显示在按钮下方 我看到了很多链接 但他们只打开列表 操作栏下拉打开和关闭项目样式 https stackoverflow com questions 15824793 actio
  • 如何在 Python 中创建通用接口?

    我想在 Python 中创建与此等效的内容 static class Event static class MyEvent extends Event interface Filter
  • React / Redux:mapStateToProps 实际上并未将状态映射到 props

    我在一个项目中使用 React 和 Redux 但在实现启用 禁用按钮的功能时遇到问题 我已经能够 触发一个方法 让该方法触发动作创建者 调度一个动作 在减速器中捕获该操作并创建一个新的更新状态 在 Redux DevTools 中查看更新
  • 在 for 循环中引用/取消引用向量元素

    在下面的代码中 我想保留number list 迭代之后 因为 into iter that for默认使用会消耗 因此 我假设n i32我可以获得的值n通过解除引用 fn main let number list vec 24 34 10
  • 如何在JTable中添加JCheckBox?

    首先 我为我的英语疏忽表示歉意 我将解释我所有的问题 首先我想在我拥有的 JTable 中使用 JCheckBox 我正在从数据库的列索引 0 和 1 中检索学生 ID 和学生姓名 我希望第三列应该是缺席 在场 最初将通过 JCheckbo
  • TinyMCE - 附加到通过 AJAX 调用加载的 div

    我知道以前有人问过这个问题 但我正在尝试通过 jQuery AJAX 加载一些附加到 tinymce 实例的 div 在AJAX加载的页面中 有几个tinymce div 它们是由PHP循环创建的 div p Some text p div
  • 无法在 C# 中使用 Sendkeys 发送下划线?

    我很无聊 所以我尝试编写一个程序 在按 ctrl shift L 时写出不赞成的笑脸 脸 现在一切正常 除了笑脸中的下划线 它根本不会被写出来 这是我首先使用的 SendKeys Send 我尝试过各种方法 比如在下划线周围添加 括号 当然
  • R/Igraph 在边列表中显示边权重?

    当将图形对象作为边列表查看时 有什么方法可以显示边权重吗 我想本着以下精神做一些事情 get edgelist graph attr weight 以便查看与节点旁边列出的权重的边缘配对 但这似乎是不允许的 我知道如何查看权重的唯一方法是将
  • iPhone:当其他视图存在ViewController时如何防止关闭键盘

    我的 iPhone 应用程序出现问题 有一个 2UIViewController First UIViewController with UITextField和键盘向上 一旦我将打开其他UIViewController有了presentV
  • 为什么我需要在 swift 中使用下划线?

    Here https www weheartswift com tuples enums 它说 注意 意思是 我不关心那个值 但是来自 JavaScript 我不明白这意味着什么 我可以打印这些函数的唯一方法是在参数之前使用下划线 func
  • Rx.Net - 处理 Observable.Create() 期间创建的资源

    我正在尝试将 Rx net 用于项目 但我遇到了如何正确处置在Observable Create 并发出OnNext 我的设置如下所示 希望仅缩短到相关位 var obs Observable Create
  • 设置gunicorn与systemd一起运行

    正在尝试设置gunicorn与一起运行systemd 控制文件是 etc systemd system gunicorn service测试的输出是 root samuel pc systemctl start gunicorn Faile