plugorgau / eventstreamr

Single and multi room audio visual stream management.
GNU Affero General Public License v3.0
6 stars 12 forks source link

API Trigger Restart #17

Closed techman83 closed 10 years ago

techman83 commented 10 years ago

It would be handy to be able to trigger a restart of the manager daemon via the api, making pushing out code changes much easier if something needs patching in a hurry.

techman83 commented 10 years ago

Not sure how best to achieve this. One way would be to call a shell script on boot ie 'start_mgr.sh &'

#!/bin/bash 
while [  1 == 1 ]; do
  /path/to/station-mgr.pl --no-daemon
done

Another option would be daemon-tools -> http://cr.yp.to/daemontools.html

Thoughts?

techman83 commented 10 years ago

Pointer from @nimm - use exec. Found an example of such an operation:

http://www.perlmonks.org/?node_id=440900

techman83 commented 10 years ago

Runs

eventstreamr/baseimage/update-host.sh

And then execs itself. Seems to work correctly. Can be called via the api

wget localhost:3000/manager/update -O -