mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-22 02:16:43 +00:00
Merge pull request #131 from resin-io/remove-more-terminal
Remove even more old terminal related stuff.
This commit is contained in:
commit
941cc76b85
@ -8,7 +8,6 @@ RUN apt-get -q update \
|
|||||||
btrfs-tools \
|
btrfs-tools \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
rsync \
|
rsync \
|
||||||
socat \
|
|
||||||
supervisor \
|
supervisor \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@ -34,8 +33,7 @@ RUN apt-get -q update \
|
|||||||
# Copy source
|
# Copy source
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
RUN chmod +x /app/src/enterContainer.sh \
|
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||||
&& /app/node_modules/.bin/coffee -c /app/src \
|
|
||||||
&& ln -sf /app/entry.sh /start # Needed for legacy
|
&& ln -sf /app/entry.sh /start # Needed for legacy
|
||||||
|
|
||||||
RUN chmod +x /app/bin/gosuper
|
RUN chmod +x /app/bin/gosuper
|
||||||
|
@ -8,7 +8,6 @@ RUN apt-get -q update \
|
|||||||
btrfs-tools \
|
btrfs-tools \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
rsync \
|
rsync \
|
||||||
socat \
|
|
||||||
supervisor \
|
supervisor \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@ -34,8 +33,7 @@ RUN apt-get -q update \
|
|||||||
# Copy source
|
# Copy source
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
RUN chmod +x /app/src/enterContainer.sh \
|
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||||
&& /app/node_modules/.bin/coffee -c /app/src \
|
|
||||||
&& ln -sf /app/entry.sh /start # Needed for legacy
|
&& ln -sf /app/entry.sh /start # Needed for legacy
|
||||||
|
|
||||||
RUN chmod +x /app/bin/gosuper
|
RUN chmod +x /app/bin/gosuper
|
||||||
|
@ -8,7 +8,6 @@ RUN apt-get -q update \
|
|||||||
btrfs-tools \
|
btrfs-tools \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
rsync \
|
rsync \
|
||||||
socat \
|
|
||||||
supervisor \
|
supervisor \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@ -34,8 +33,7 @@ RUN apt-get -q update \
|
|||||||
# Copy source
|
# Copy source
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
RUN chmod +x /app/src/enterContainer.sh \
|
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||||
&& /app/node_modules/.bin/coffee -c /app/src \
|
|
||||||
&& ln -sf /app/entry.sh /start # Needed for legacy
|
&& ln -sf /app/entry.sh /start # Needed for legacy
|
||||||
|
|
||||||
RUN chmod +x /app/bin/gosuper
|
RUN chmod +x /app/bin/gosuper
|
||||||
|
@ -8,7 +8,6 @@ RUN apt-get -q update \
|
|||||||
btrfs-tools \
|
btrfs-tools \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
rsync \
|
rsync \
|
||||||
socat \
|
|
||||||
supervisor \
|
supervisor \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@ -34,8 +33,7 @@ RUN apt-get -q update \
|
|||||||
# Copy source
|
# Copy source
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
RUN chmod +x /app/src/enterContainer.sh \
|
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||||
&& /app/node_modules/.bin/coffee -c /app/src \
|
|
||||||
&& ln -sf /app/entry.sh /start # Needed for legacy
|
&& ln -sf /app/entry.sh /start # Needed for legacy
|
||||||
|
|
||||||
RUN chmod +x /app/bin/gosuper
|
RUN chmod +x /app/bin/gosuper
|
||||||
|
@ -8,7 +8,6 @@ RUN apt-get -q update \
|
|||||||
btrfs-tools \
|
btrfs-tools \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
rsync \
|
rsync \
|
||||||
socat \
|
|
||||||
supervisor \
|
supervisor \
|
||||||
--no-install-recommends \
|
--no-install-recommends \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
@ -34,8 +33,7 @@ RUN apt-get -q update \
|
|||||||
# Copy source
|
# Copy source
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
|
|
||||||
RUN chmod +x /app/src/enterContainer.sh \
|
RUN /app/node_modules/.bin/coffee -c /app/src \
|
||||||
&& /app/node_modules/.bin/coffee -c /app/src \
|
|
||||||
&& ln -sf /app/entry.sh /start # Needed for legacy
|
&& ln -sf /app/entry.sh /start # Needed for legacy
|
||||||
|
|
||||||
RUN chmod +x /app/bin/gosuper
|
RUN chmod +x /app/bin/gosuper
|
||||||
|
14
bin/enter.sh
14
bin/enter.sh
@ -1,14 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ -f /usr/bin/rce ]; then
|
|
||||||
ENGINE=rce
|
|
||||||
else
|
|
||||||
ENGINE=docker
|
|
||||||
fi
|
|
||||||
|
|
||||||
CONTAINER_PID=$($ENGINE inspect --format '{{if .State.Running}}{{.State.Pid}}{{end}}' $1)
|
|
||||||
if [ -z $CONTAINER_PID ]; then
|
|
||||||
read -p "Application must be running for a terminal to be started."
|
|
||||||
else
|
|
||||||
nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'while IFS= read -r -d "" var; do export "$var"; done < /proc/1/environ; exec bash'
|
|
||||||
fi
|
|
6
entry.sh
6
entry.sh
@ -9,12 +9,6 @@ set -e
|
|||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
|
|
||||||
DATA_DIRECTORY=/data
|
|
||||||
if [ -d "$DATA_DIRECTORY" ]; then
|
|
||||||
cp bin/enter.sh $DATA_DIRECTORY/enter.sh
|
|
||||||
chmod +x $DATA_DIRECTORY/enter.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log
|
||||||
mkdir -p /var/run/resin
|
mkdir -p /var/run/resin
|
||||||
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
mount -t tmpfs -o size=1m tmpfs /var/run/resin
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
SOCKET_NAME=test-${1}-${2}-${3}
|
|
||||||
HOST_DATA_PATH=/resin-data/resin-supervisor
|
|
||||||
HOST_SOCKET=${HOST_DATA_PATH}/${SOCKET_NAME}
|
|
||||||
SUPERVISOR_SOCKET_PATH=/data
|
|
||||||
COMMAND_SOCKET=${SUPERVISOR_SOCKET_PATH}/host
|
|
||||||
|
|
||||||
if [ ! -S ${COMMAND_SOCKET} ]; then
|
|
||||||
read -p 'TTY mode not supported on this image, please update.'
|
|
||||||
else
|
|
||||||
echo "
|
|
||||||
rm -f ${HOST_SOCKET}
|
|
||||||
socat UNIX-LISTEN:${HOST_SOCKET} EXEC:'${HOST_DATA_PATH}/enter.sh ${1}',pty,setsid,setpgid,stderr,ctty &
|
|
||||||
exit
|
|
||||||
" | socat UNIX:${COMMAND_SOCKET} - >& /dev/null
|
|
||||||
socat UNIX:${SUPERVISOR_SOCKET_PATH}/${SOCKET_NAME} -,raw,echo=0
|
|
||||||
fi
|
|
@ -36,7 +36,6 @@ RUN apt-get update \
|
|||||||
python-dev \
|
python-dev \
|
||||||
rsyslog \
|
rsyslog \
|
||||||
rsyslog-gnutls \
|
rsyslog-gnutls \
|
||||||
socat \
|
|
||||||
vim \
|
vim \
|
||||||
wget \
|
wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
@ -83,6 +82,5 @@ COPY config/services/ /etc/systemd/system/
|
|||||||
COPY resin-vars vpn-init /usr/src/app/
|
COPY resin-vars vpn-init /usr/src/app/
|
||||||
|
|
||||||
RUN systemctl enable resin-supervisor-dind
|
RUN systemctl enable resin-supervisor-dind
|
||||||
RUN systemctl enable resin-supervisor-host-socket
|
|
||||||
|
|
||||||
CMD env > /etc/docker.env; exec /sbin/init
|
CMD env > /etc/docker.env; exec /sbin/init
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Host socket for resin supervisor
|
|
||||||
Requires=resin-supervisor.service
|
|
||||||
After=resin-supervisor.service
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Restart=always
|
|
||||||
ExecStartPre=-/bin/rm -f /resin-data/resin-supervisor/host
|
|
||||||
ExecStart=/bin/bash -c ' \
|
|
||||||
while true; do \
|
|
||||||
rm -f /resin-data/resin-supervisor/host; \
|
|
||||||
socat UNIX-LISTEN:/resin-data/resin-supervisor/host EXEC:/bin/bash,pty,setsid,setpgid,stderr,ctty; \
|
|
||||||
done'
|
|
||||||
ExecStopPost=-/bin/rm -f /resin-data/resin-supervisor/host
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
Loading…
x
Reference in New Issue
Block a user