Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

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

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).

share|improve this answer

You must log in to answer this question.

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