mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-03 16:53:45 +00:00
47 lines
1.1 KiB
Plaintext
Executable File
47 lines
1.1 KiB
Plaintext
Executable File
#!/sbin/openrc-run
|
|
|
|
depend()
|
|
{
|
|
before docker
|
|
}
|
|
|
|
start()
|
|
{
|
|
[ "$(mobyplatform)" != "mac" ] && [ "$(mobyplatform)" != "windows" ] && exit 0
|
|
|
|
ebegin "Setting up proxy port service"
|
|
|
|
mkdir -p /port
|
|
if [ "$(mobyplatform)" = "windows" ]; then
|
|
# Running on a Hyper-V hypervisor
|
|
/sbin/9pmount-vsock --serviceid 0B95756A-9985-48AD-9470-78E060895BE7 listen port /port
|
|
else
|
|
mount -t 9p -o trans=virtio,dfltuid=1001,dfltgid=50,version=9p2000 port /port
|
|
fi
|
|
[ -n "${PIDFILE}" ] || PIDFILE=/var/run/proxy-vsockd.pid
|
|
[ -n "${LOGFILE}" ] || LOGFILE=/var/log/proxy-vsockd.log
|
|
|
|
ulimit -n 1048576
|
|
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()
|
|
{
|
|
[ "$(mobyplatform)" != "mac" ] && [ "$(mobyplatform)" != "windows" ] && exit 0
|
|
|
|
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"
|
|
}
|