简体   繁体   English

Ubuntu Screen命令无法识别Lumen Queue命令

[英]Ubuntu Screen command does not recognize Lumen Queue command

I am in a bit of a situation where I need to manually restart queues on linux/ubuntu based box and the proper approach I was told to follow is to use the screen command line application. 我有一种情况,我需要在基于linux / ubuntu的盒子上手动重新启动队列,而被告知遵循的正确方法是使用屏幕命令行应用程序。

I am on Ubuntu 14.X and when I do an -ls command I can actually see the sessions running on the server. 我在Ubuntu 14.X上,当我执行-ls命令时,我实际上可以看到服务器上正在运行的会话。 Below is a command I would run if I was outside screen session: 以下是我在屏幕外会话时要运行的命令:

mycommandline$ php artisan queue:restart

Now the issue is that if from the -ls output I grab the session's port to include in the command I run I get the error below: 现在的问题是,如果我从-ls输出中获取了会话的端口以包含在我运行的命令中,则会得到以下错误:

Cannot exec 'php artisan queue': No such file or directory 无法执行“ php artisan queue”:没有这样的文件或目录

I also tried typing screen "php artisan queue:restart" and I keep getting the same issue. 我还尝试键入screen "php artisan queue:restart" ,但我一直遇到相同的问题。

I am not farmiliar at all with the screen program and any suggestions to point me to the right direction would be much appreciated. 我对屏幕程序一点都不陌生,任何将我指向正确方向的建议将不胜感激。

Okay digging through google I came up with the command below. 好吧,通过谷歌挖掘我想出了下面的命令。 Given that I already had a session that was running I needed to make sure that I send my commands on that same session just to be sure. 鉴于我已经有一个正在运行的会话,因此需要确保在同一会话上发送命令。 Below is what I ended up doing which does confirm that something is happenning within the screen session: 以下是我最终完成的操作,该操作确实确认屏幕会话中正在发生某些事情:

luyanda@devbox:~$ screen -d -r 19167 -p0 -x stuff "free -g; php artisan queue:restart"
Attaching from inside of screen?

As I am not seeing any visible issues I am convinced that this is what I needed to do given that my log file is updating as well it either means that the queues never stopped working or I managed to restart them. 因为我没有看到任何可见的问题,所以我确信这是我需要做的,因为我的日志文件也在更新,这或者意味着队列从未停止工作,或者我设法重新启动了它们。

What I am still interested to know is how I can actually see the output of the commands I send to my session else if I can rather pipe the output somewhere else. 我仍然想知道的是,如果我宁愿将输出通过管道传输到其他地方,我如何才能真正看到发送到会话的命令的输出。

Any thoughts? 有什么想法吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM