1

I'm trying to launch a PHP script in the background (Linux/Centos 6.8) by appending the & symbol to the command. However, 'jobs' lists the script with status [1]+ Stopped. Issuing a 'bg 1' to run the script in the background still results in a "[1]+ Stopped" output.

I can issue 'fg 1' and the script runs in the foreground with no problems.

What am I doing wrong?

I am piping both stdout and stderr to files using > output.txt 2> error.txt

The script issues some shell commands including wget.

Thanks for any info to clarify this.

Ryan Griggs
  • 963
  • 2
  • 14
  • 29
  • What have you done with standard input? Contact the script's developer and let them know of the problem. – Michael Hampton Jan 23 '17 at 21:53
  • The script needs no input. I am the script developer. :) – Ryan Griggs Jan 23 '17 at 21:56
  • Something needs input, otherwise the script would continue running. – Michael Hampton Jan 23 '17 at 22:15
  • It doesn't read from stdin at all. It simply runs wget to retrieve some security camera images directly to files. Would wget be causing this? – Ryan Griggs Jan 23 '17 at 22:29
  • It looks like wget is the culprit. If I create another script to simply write the numbers 1-60 to the stdout, sleeping 1 second between each, it works fine. – Ryan Griggs Jan 23 '17 at 22:31
  • What is wget doing to suspend the script? I can launch it in the foreground and it runs fine, never stops to wait on user input, and never displays anything to the screen. I can tail the log file and it continues to grow as it should. – Ryan Griggs Jan 23 '17 at 22:31

0 Answers0