CenturyLinkLabs / ctlc-docker-ambassador

MIT License
13 stars 11 forks source link

Doesn't run correctly #1

Open dhm116 opened 10 years ago

dhm116 commented 10 years ago

If I follow the example shown in the readme, I get the following output:

docker run --rm --link something:something --name something_ambassador -p 5000:5000 ctlc/ambassador

2014-04-09 16:22:43,576 CRIT Supervisor running as root (no user in config file)
2014-04-09 16:22:43,576 WARN Included extra file "/etc/supervisor/conf.d/supervisord-socat.conf" during parsing
2014-04-09 16:22:43,592 INFO RPC interface 'supervisor' initialized
2014-04-09 16:22:43,592 WARN cElementTree not installed, using slower XML parser for XML-RPC
2014-04-09 16:22:43,592 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-04-09 16:22:43,592 INFO supervisord started with pid 1
2014-04-09 16:22:44,595 INFO spawned: 'socat' with pid 7
2014-04-09 16:22:44,602 INFO exited: socat (exit status 0; not expected)
2014-04-09 16:22:45,606 INFO spawned: 'socat' with pid 18
2014-04-09 16:22:45,613 INFO exited: socat (exit status 0; not expected)
2014-04-09 16:22:45,615 CRIT reaped unknown pid 24)
2014-04-09 16:22:45,617 CRIT reaped unknown pid 27)
2014-04-09 16:22:45,619 CRIT reaped unknown pid 25)
2014-04-09 16:22:45,620 CRIT reaped unknown pid 26)
2014-04-09 16:22:45,620 CRIT reaped unknown pid 23)
2014-04-09 16:22:45,620 CRIT reaped unknown pid 28)
2014-04-09 16:22:47,632 INFO spawned: 'socat' with pid 29
2014-04-09 16:22:47,641 INFO exited: socat (exit status 0; not expected)
2014-04-09 16:22:47,642 CRIT reaped unknown pid 35)
2014-04-09 16:22:47,642 CRIT reaped unknown pid 38)
2014-04-09 16:22:47,643 CRIT reaped unknown pid 39)
2014-04-09 16:22:47,645 CRIT reaped unknown pid 34)
2014-04-09 16:22:47,645 CRIT reaped unknown pid 36)
2014-04-09 16:22:47,645 CRIT reaped unknown pid 37)
2014-04-09 16:22:50,665 INFO spawned: 'socat' with pid 40
2014-04-09 16:22:50,673 INFO exited: socat (exit status 0; not expected)
2014-04-09 16:22:50,676 INFO gave up: socat entered FATAL state, too many start retries too quickly
2014-04-09 16:22:50,677 CRIT reaped unknown pid 45)
2014-04-09 16:22:50,678 CRIT reaped unknown pid 47)
2014-04-09 16:22:50,678 CRIT reaped unknown pid 48)
2014-04-09 16:22:50,678 CRIT reaped unknown pid 50)
2014-04-09 16:22:50,680 CRIT reaped unknown pid 46)
2014-04-09 16:22:50,680 CRIT reaped unknown pid 49)

I imagine it's failing because even if I attempt to run the env | grep _TCP= | sed 's/.*_PORT_\([0-9]*\)_TCP=tcp:\/\/\(.*\):\(.*\)/socat -ls TCP4-LISTEN:\1,fork,reuseaddr TCP4:\2:\3 \&/' | sh command within the container, it produces:

sh: 1: socat: not found
sh: 2: socat: not found
sh: 3: socat: not found

Any suggestions?

lcheng61 commented 10 years ago

I was trying ambassador and got hit by the same issue. Any solutions ?

grmblfrz commented 10 years ago

The problem is, that /start-socat.sh puts socat into the background by adding an ampersand, but supervisord expects it in foreground. If you change /start-socat.sh to:

#!/bin/bash
env | grep _TCP= | sed 's/.*_PORT_\([0-9]*\)_TCP=tcp:\/\/\(.*\):\(.*\)/socat -ls TCP4-LISTEN:\1,fork,reuseaddr TCP4:\2:\3/' | sh

it should work better.