laravel 主管没有这样的文件 socket.py

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41286526/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 14:59:06  来源:igfitidea点击:

Supervisor no such file socket.py

laravelubuntuhomesteadsupervisord

提问by Michael

I am trying to setup a queue listener for laravel and cannot seem to get supervisor working correctly. I get the following error when I run supervisorctl reload:

我正在尝试为 laravel 设置一个队列侦听器,但似乎无法让主管正常工作。运行时出现以下错误supervisorctl reload

error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228

error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib/python2.7/socket.py line: 228

The file DOES exist. If try to run sudo supervisorctlI get this unix:///var/run/supervisor.sock no such file.

该文件确实存在。如果尝试运行,sudo supervisorctl我会得到这个 unix:///var/run/supervisor.sock no such file

I've tried reinstall supervisor and that did not work either. Not sure what to do here.

我试过重新安装主管,但也没有用。不知道在这里做什么。

I'm running Laravel Homestead (Ubuntu 16.04).

我正在运行 Laravel Homestead (Ubuntu 16.04)。

Result of service supervisor status:
vagrant@homestead:~/Code$ sudo service supervisor status ● supervisor.service - Supervisor process control system for UNIX Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Thu 2016-12-22 11:06:21 EST; 41s ago Docs: http://supervisord.org Process: 23154 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS) Process: 23149 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2) Main PID: 23149 (code=exited, status=2)

结果service supervisor status
vagrant@homestead:~/Code$ sudo service supervisor status ● supervisor.service - Supervisor process control system for UNIX Loaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled) Active: activating (auto-restart) (Result: exit-code) since Thu 2016-12-22 11:06:21 EST; 41s ago Docs: http://supervisord.org Process: 23154 ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown (code=exited, status=0/SUCCESS) Process: 23149 ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf (code=exited, status=2) Main PID: 23149 (code=exited, status=2)

采纳答案by Michael

I ended up just removing supervisor entirely, reinstalling and rewriting my config files. I must have just done something wrong in the process and wasn't able to catch it.

我最终只是完全删除了主管,重新安装并重写了我的配置文件。我一定是在这个过程中做错了什么而没能抓住它。

回答by Galdil

You should run sudo service supervisor startwhen you are in the supervisor dir.
Worked for me.

您应该sudo service supervisor start在主管目录中运行。
对我来说有效。

回答by nwaweru

2020 UPDATE

Try running sudo service supervisor startin your terminal before using the below solution. I found out that the issue sometimes occurs when supervisoris not running, nothing complicated.

2020 更新

sudo service supervisor start在使用以下解决方案之前尝试在终端中运行。我发现这个问题有时会在supervisor不运行时发生,没什么复杂的。

I am using Ubuntu 18.04. I had the same problem and re-installing supervisor did not solve my problem.

我正在使用Ubuntu 18.04. 我遇到了同样的问题,重新安装主管并没有解决我的问题。

I ended up completely removing the conf.d directory and recreating it with new configs. Make sure you back up your configurations before trying this:

我最终完全删除了 conf.d 目录并使用新配置重新创建它。在尝试此操作之前,请确保备份您的配置

  1. sudo rm -rf /etc/supervisor/conf.d/
  2. sudo mkdir /etc/supervisor/conf.d
  3. sudo nano /etc/supervisor/conf.d/my-file.conf
  4. Copy+Paste your configuration into your new file.
  1. sudo rm -rf /etc/supervisor/conf.d/
  2. sudo mkdir /etc/supervisor/conf.d
  3. sudo nano /etc/supervisor/conf.d/my-file.conf
  4. 将您的配置复制+粘贴到新文件中。

sudo supervisorctl rereadstarted working again.

sudo supervisorctl reread又开始工作了。

回答by Madacol

In Ubuntu 18.04 with distribution's package

在带有分发包的 Ubuntu 18.04 中

You probably did the same mistake as me an created the config file /etc/supervisord.confwhile my service manager (systemd) was using the config file /etc/supervisor/supervisord.conf

您可能犯了和我一样的错误,/etc/supervisord.conf在我的服务管理器 ( systemd) 使用配置文件时创建了配置文件/etc/supervisor/supervisord.conf

sudo rm /etc/supervisord.conf

sudo rm /etc/supervisord.conf

Or

或者

sudo mv /etc/supervisord.conf /etc/supervisor/supervisord.conf

sudo mv /etc/supervisord.conf /etc/supervisor/supervisord.conf

if you want to keep it

如果你想保留它

Now you can run sudo supervisorctl

现在你可以运行 sudo supervisorctl



Why?

为什么?

when you run supervisorctlit first searches for the config file located at /etc/supervisord.conf, if it's not present, it will search for the package's default file /etc/supervisor/supervisord.confthis is the one systemdactually runs.

当您运行supervisorctl它时,首先搜索位于 的配置文件/etc/supervisord.conf,如果它不存在,它将搜索包的默认文件,/etc/supervisor/supervisord.conf这是systemd实际运行的文件。

Systemdalways use the file /etc/supervisor/supervisord.confregardless of the other file's existence.

/etc/supervisor/supervisord.conf无论其他文件是否存在,Systemd始终使用该文件。

You can check which file is using systemdby running sudo systemctl status supervisor

您可以通过运行来检查哪个文件正在使用systemdsudo systemctl status supervisor

enter image description hereYou can see in the last line the command where the config file is hardcoded

在此处输入图片说明您可以在最后一行看到配置文件被硬编码的命令

回答by Somansh Reddy

Check the supervisord.conffile.

检查supervisord.conf文件。

Look for the following:

查找以下内容:

[unix_http_server]
file=/path/to/supervisor.sock/file   ; (the path to the socket file)   
chmod=0700                           ; sockef file mode(default 0700)

Go to the path mentioned above and check if the file is present.
If it is present then try re-installing supervisor.

转到上面提到的路径并检查文件是否存在。
如果存在,请尝试重新安装主管。

If not then search for supervisor.sockfile either using the command line or file explorer GUI.

如果没有,则使用命令行或文件浏览器 GUI搜索supervisor.sock文件。

Copy the file found in the above step to the location specified in the [unix_http_server] by using the cp command or GUI.

使用 cp 命令或 GUI 将上述步骤中找到的文件复制到 [unix_http_server] 中指定的位置。

For me, the supervisor.sockwas present in the /run folder.

对我来说,supervisor.sock存在于 /run 文件夹中。

回答by Eliefly

you can try

你可以试试

sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock