chendo / lifx-http

A HTTP API for controlling LIFX devices.
MIT License
91 stars 13 forks source link

Running in the background (hack) #12

Closed dangreenisrael closed 8 years ago

dangreenisrael commented 10 years ago

I get the server running in the background, and deal with it potentially crashing by running this php script as a cron:

// This lets me run the script on an interval
exec('pkill lifx-http');
echo "killed LIFX";

// The nohum and & let me keep running commands after the server is launched
$command = 'lifx-http';
exec("nohup $command >/dev/null 2>/dev/null &"); 
echo 'started LIFX server';

// I exit the script to prevent any system hang
exit;
zembrowski commented 10 years ago

Hi Dan,

how did you manage to run lifx-http in the background?

Cheers, Krzysztof

dangreenisrael commented 10 years ago

I think that I ran it through a php script calling it with && to be asynchronous but I don’t remember

On Nov 23, 2014, at 16:26, Krzysztof Tomasz Zembrowski notifications@github.com wrote:

Hi Dan,

how did you manage to run lifx-http in the background?

Cheers, Krzysztof

— Reply to this email directly or view it on GitHub https://github.com/chendo/lifx-http/issues/12#issuecomment-64119611.

justinatomatic commented 9 years ago

If your using RVM you can generate wrapper scripts and then run lifx-httpd with any process control app.

I've got it working with supervisor.

http://omaticlabs.com/homepage/24/lifx-http-supervisor