0

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.

I am on Ubuntu 14.X and when I do an -ls command I can actually see the sessions running on the server. 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:

Cannot exec 'php artisan queue': No such file or directory

I also tried typing screen "php artisan queue:restart" and I keep getting the same issue.

I am not farmiliar at all with the screen program and any suggestions to point me to the right direction would be much appreciated.

scruffycoder86
  • 527
  • 1
  • 5
  • 24
  • you need to fullpath to artisan – Farkie Dec 23 '16 at 09:12
  • first you have to go your project directory (Ex:- cd D:/www/myproject) then try to run artisan command – SarangaR Dec 23 '16 at 09:18
  • @Farkie I have just tried that by locating the alias I am using and if I test the full path on the command line itself it is working but if I do `screen "php /path/to/artisan" I get same message pinting to the full path and then one that says "[screen is terminating]". @SarangaR I already can do that and it is what I have been doing but I was advised to rather interact with the system through the screen session application for whatever reason my boss knows. – scruffycoder86 Dec 23 '16 at 09:37

1 Answers1

1

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?

scruffycoder86
  • 527
  • 1
  • 5
  • 24