Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug #5

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: DEBUG

on: pull_request

jobs:
setup:
name: debug
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: debug
working-directory: .
run: |
sh test_hostname.sh
33 changes: 33 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/bash
doo() {
echo "starting"
sleep 20
echo "finishing"
}

doo </dev/null &>agg.log &
p=$!
echo $p

sleep 2

doo </dev/null &>agg.log &
q=$!
echo $q

echo "/proc/$p"
echo "/proc/$q"
echo "/proc/${p}"
echo "/proc/${q}"

[ -d "/proc/$p" ] && echo "p exists" || echo "p not exists"
[ -d "/proc/$q" ] && echo "q exists" || echo "q not exists"

echo "waiting p"
wait $p

echo "waiting q"
wait $q

echo "waiting all"
wait
15 changes: 15 additions & 0 deletions test_hostname.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
hostname -A
hostname -I

BIND_ADDRESS=$(hostname -I | cut -d " " -f 1)
HOSTNAME_=$(hostname -I | cut -d " " -f 1)

echo $BIND_ADDRESS
echo $HOSTNAME_

CONTAINER1=$(docker run --rm -p $BIND_ADDRESS:80:80 -d httpd)
CONTAINER2=$(docker run --rm -i --entrypoint bash -d httpd)
sleep 2
docker exec $CONTAINER2 bash -c "apt-get -qq update && apt-get -qq install curl net-tools -y && echo && route && echo && curl -s $HOSTNAME_"
docker stop $CONTAINER2 >/dev/null
docker stop $CONTAINER1 >/dev/null
Loading