Skip to content

Commit 370cfce

Browse files
committed
Squashed commit of the following:
commit 2826022 Author: Maxfield Lehman <_@maxfieldlehman.com> Date: Tue Oct 2 06:30:29 2018 -0700 Prevent container from erroneously exiting immediately. commit 4583639 Author: Maxfield Lehman <_@maxfieldlehman.com> Date: Tue Oct 2 06:12:16 2018 -0700 Kill sshd on SIGTERM instead of waiting for docker stop timeout.
1 parent 1b39af2 commit 370cfce

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

start.sh

100644100755
Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/sh
22

3+
_term() {
4+
echo "Caught SIGTERM signal!"
5+
kill -TERM "$child" 2>/dev/null
6+
}
7+
8+
trap _term SIGTERM
9+
310
ssh-keygen -A
411

512
# If there are some public keys in keys folder
@@ -20,5 +27,7 @@ if [ "$(ls -A /git-server/repos/)" ]; then
2027
find /git-server/repos -type d -exec chmod g+s '{}' +
2128
fi
2229

23-
# -D flag avoids executing sshd as a daemon
24-
/usr/sbin/sshd -D
30+
/usr/sbin/sshd -D &
31+
32+
child=$!
33+
wait "$child"

0 commit comments

Comments
 (0)