LitusProject/Litus — pull request #189 by bgotink (2014-03-23 18:35:11+00:00)
Title: Scripts update

This PR contains

- a small update for the `bin/update.sh` script
- a complete rewrite of the `bin/sockets.sh` script.

## About the sockets:

- instead of having a cron job running every minute to restart the sockets.sh script, the script should be started only once. It keeps on running until it is killed using `^C/SIGINT`, `SIGTERM` or `SIGQUIT`.
- running `bin/sockets.sh` twice will not result in starting the sockets twice: the second call will send `SIGUSR1` to the first script, which restarts the sockets.

### Long story short:

- Installation
- create `/var/run/litus`, chown to www-data (_www on OS X)
- change the `socket_path` configuration entry if needed (e.g. when deploying multiple systems)
- Running
- start `bin/sockets.sh` once as www-data/_www while piping output to a log file
- run `bin/sockets.sh` as www-data/_www or simply as root after every update to restart the sockets
- perhaps even run bin/sockets.sh every day or so to restart sockets with clean slate?

### Possible addition:

A script for `/etc/init.d` to control this script:

- `service litus-sockets start` would start the script as daemon
- `service litus-sockets restart` could
- send `SIGUSR1` to the daemon script, or
- restart the daemon script (`SIGTERM` & wait, then start anew)
- `service litus-sockets stop` would send `SIGTERM` to the daemon script

### Notes

- Currently blocked on doctrine/DoctrineModule#400