Jump to content

system(), passthru(), shell_exec(), exec() hangs


msknight

Recommended Posts

Same problem as a post a few months ago, but a different cause.

I write tools to support people running L2J servers, and I have a problem ...

The script detects whether the gameserver is down, and if it is, then it it tasked with restarting it.

The program correctly executes the script, which contains a command ...
#! /bin/sh
./GameServer_loop.sh &.
... which then calls a looping .sh file.

The issue of this is that, of course, the whole thing never ends and even if I shut down the gameserver, the program hangs ... presumably waiting for some return from the command so that the script can continue executing.

This, obviously, won't happen.

What I need is a way of running a system command, and telling the PHP script not to bother waiting for a response ... just continue running.

Any ideas please?
Link to comment
https://forums.phpfreaks.com/topic/33729-system-passthru-shell_exec-exec-hangs/
Share on other sites

Hi Thorpe,

The purpose of the pHP code is to actually start the program and not bother with anything that the script outputs.  The job of the PHP code is to start the script in event that the script stops.

I've got it so that it knows when the script needs to be run again, but it just hangs on issuing the exec command.

Michelle.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.