Files
linuxkit/alpine/packages/proxy/etc/init.d/proxy
David Scott 5090fd9599 proxy: add a multiplexing server frontend
On a Hyper-V system we can only register one listening endpoint (with
a GUID), so we need to accept connections, read a header and then
start the proxy.

If the binary has argv[0] == "proxy-vsockd" then run this new frontend.

Signed-off-by: David Scott <dave.scott@docker.com>
2016-05-22 12:43:18 +01:00

38 lines
813 B
Plaintext
Executable File

#!/sbin/openrc-run
depend()
{
before docker
}
start()
{
ebegin "Setting up proxy port service"
mkdir -p /port
mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 port /port
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/proxy-vsockd.pid
[ -n "${LOGFILE}" ] || LOGFILE=/var/log/proxy-vsockd.log
start-stop-daemon --start --quiet \
--background \
--exec /sbin/proxy-vsockd \
--make-pidfile --pidfile ${PIDFILE} \
--stderr "${LOGFILE}" --stdout "${LOGFILE}" \
-- -vsockPort 62373 -hvGuid 0B95756A-9985-48AD-9470-78E060895BE7
eend $? "Failed to start proxy port service"
}
stop()
{
ebegin "Stopping proxy port service"
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/proxy-vsockd.pid
start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
eend $? "Failed to stop proxy-vsockd"
}