2

I'm using phpseclib to run a shell script on my server at a given interval. That script involves using nohup. For whatever reason, if there isn't a user ready to send SIGINT or a return to nohup once it's launched, it kills the process.

For instance, if I run the script via a local prompt it runs, then all I have to do is hit enter and I get a new cmd prompt. When I try and run it automatedly, I can't pass the return or a SIGINT and the process never finishes. Ideas?

3
  • Have you tried replacing nohup with GNU screen? What function does nohup provide that can't be provided by screen? Commented Nov 3, 2012 at 6:07
  • @allquixotic Screen requires an active terminal, and therefore cannot be run solely over an ssh command. Commented Nov 3, 2012 at 17:01
  • Are you already aware of the information in this AU post? Commented Nov 3, 2012 at 19:03

1 Answer 1

0

Normally I've used an ugly TCL/Tk framework called Expect to do this sort of thing in the past. I noticed there is a php version of expect called PHP:Expect. Perhaps that will help here?

Expect should allow you to simulate a console connection and send any key squence. Be warned though these frameworks can be painful. If you aren't tied to PHP take a look at Ashier which sounds awesome (although I've never used it).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .