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
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.