Run tyk-analystics as daemon

Imported Google Group message. Original thread at: Redirecting to Google Groups Import Date: 2016-01-19 21:14:43 +0000.
Sender:Jeyhun Jey.
Date:Tuesday, 19 May 2015 15:40:36 UTC+1.

anybody can help me to run tyk dashboard as daemon? thanks? OS Ubuntu!

Imported Google Group message.
Sender:Martin Buhr.
Date:Tuesday, 19 May 2015 15:44:34 UTC+1.

Nowadays we’d say use the docker container, it’s more reliable. Golang doesn;t do daemonising very well, so we tend to recommend using supervisord to manage the processes (also makes reu you get all the logs and output in a convenient place.

Check it out, you’ll need a supervisord.conf file that looks lsomething like this (this is a very old one, it will need tweaking, but should get you on the right track):

; Tyk supervisor config file.

[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)

[supervisord]
logfile=/tmp/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=/tmp/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=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket

[program:tyk]
command=/usr/bin/tyk --conf=/etc/tyk/tyk.conf
process_name=%(program_name)s
numprocs=1
environment=GOMAXPROCS=
numprocs=1

[program:tyk-dashboard]
command=/home/tyk/tyk-analytics/tyk-analytics --conf=/home/tyk/tyk-analytics/tyk_analytics.conf --license=license.dat
process_name=%(program_name)s
numprocs=1
user=tyk
directory=/home/tyk/tyk-analytics

[program:tyk-host-manager]
command=/home/tyk/tyk-analytics/tyk-host-manager
process_name=%(program_name)s
numprocs=1
user=tyk
directory=/home/tyk/tyk-analytics

Thanks,
Martin

On Tuesday, May 19, 2015 at 3:40:36 PM UTC+1, Jeyhun Jey wrote:
anybody can help me to run tyk dashboard as daemon? thanks? OS Ubuntu!

Imported Google Group message.
Sender:Jeyhun Jey.
Date:Tuesday, 19 May 2015 15:47:23 UTC+1.

thank u. let me check and i will reply results.

On Tuesday, May 19, 2015 at 7:40:36 PM UTC+5, Jeyhun Jey wrote:
anybody can help me to run tyk dashboard as daemon? thanks? OS Ubuntu!

Imported Google Group message.
Sender:Marcelo.
Date:Sunday, 31 May 2015 14:04:22 UTC+1.

Hi,

I use Ubuntu upstart. I created the conf file /et/init/tyk-analytics.conf like this:

description “tyk analytics server”
author “tykio”

start on started mountall
stop on shutdown

respawn
respawn limit 99 5

script
export HOME="/root"
cd /etc/tyk-analytics-v0.9.3/
exec /etc/tyk-analytics-v0.9.3/tyk-analytics >> /var/log/tyk/tyk-analytics.log 2>&1
end script

post-start script
end script

And then:

service tyk-analytics start

It works very well for me. I hope I have helped.