|
|
## Running as a daemon ##
|
|
|
# Running as a daemon #
|
|
|
|
|
|
To run Tap as a daemon you are encouraged to use supervisor.
|
|
|
To run Tap as a daemon you are encouraged to use supervisor. (Doesn't work natively under windows. You should use cygwin.)
|
|
|
|
|
|
The __supervisord.conf file is there to serve as a sample configuration file for supervisor. You can use it if you find it sufficient. Copy and edit it to change the query.
|
|
|
Here is a sample supervisord.conf file for running tap
|
|
|
|
|
|
```bash
|
|
|
cp __supervisord.conf supervisord.conf
|
|
|
vi supervisord.conf
|
|
|
; Sample supervisor config file for daemonizing the twitter search to mongodb software
|
|
|
|
|
|
[inet_http_server] ; inet (TCP) server disabled by default
|
|
|
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
|
|
|
username=manorastroman ; (default is no username (open server))
|
|
|
password=kingofthedragonmen ; (default is no password (open server))
|
|
|
|
|
|
[supervisord]
|
|
|
stopsignal=INT
|
|
|
logfile=supervisord.log ; (main log file;default $CWD/supervisord.log)
|
|
|
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
|
|
|
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
|
|
|
loglevel=info ; (log level;default info; others: debug,warn,trace)
|
|
|
pidfile=supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
|
|
nodaemon=false ; (start in foreground if true;default false)
|
|
|
minfds=1024 ; (min. avail startup file descriptors;default 1024)
|
|
|
minprocs=200 ; (min. avail process descriptors;default 200)
|
|
|
|
|
|
[rpcinterface:supervisor]
|
|
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
|
|
|
|
|
[supervisorctl]
|
|
|
serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
|
|
|
username=manorastroman ; should be same as http_username if set
|
|
|
password=kingofthedragonmen ; should be same as http_password if set
|
|
|
|
|
|
[program:tap]
|
|
|
command=tap --consumer-key CONSUMERKEY --consumer-secret CONSUMERSECRET -q "janez kranjc" -v DEBUG
|
|
|
stdout_logfile=tap.log
|
|
|
stderr_logfile=tap_err.log
|
|
|
autostart=true
|
|
|
autorestart=true
|
|
|
startsecs=10
|
|
|
stopwaitsecs=10
|
|
|
```
|
|
|
|
|
|
Afterwards you can start the daemon like this (you must be in the same folder as supervisord.conf or your supervisord.conf must be /etc/)
|
... | ... | |