- Linux Networking - Basic2025년 01월 07일
- yeongki0944
- 작성자
- 2025.01.07.:04
1. 개요
쿠버네티스 네트워킹 구현을 이해하기 위해서는 리눅스 네트워킹 기초를 이해할 필요가 있음.
쿠버네티스가 본질적으로 리눅스 시스템에서 동작하는 도구이기 때문
2. Go 웹 서버 실행
# amazon liunx 2023 # git 명령어 설치 sudo dnf install git -y git --version
더보기[ec2-user@ip-10-0-3-220 ~]$ sudo dnf install git -y Amazon Linux 2023 Kernel Livepatch repository 63 kB/s | 11 kB 00:00 Dependencies resolved. ================================================================================================================================================================================================================ Package Architecture Version Repository Size ================================================================================================================================================================================================================ Installing: git x86_64 2.40.1-1.amzn2023.0.3 amazonlinux 54 k Installing dependencies: git-core x86_64 2.40.1-1.amzn2023.0.3 amazonlinux 4.3 M git-core-doc noarch 2.40.1-1.amzn2023.0.3 amazonlinux 2.6 M perl-Error noarch 1:0.17029-5.amzn2023.0.2 amazonlinux 41 k perl-File-Find noarch 1.37-477.amzn2023.0.6 amazonlinux 26 k perl-Git noarch 2.40.1-1.amzn2023.0.3 amazonlinux 42 k perl-TermReadKey x86_64 2.38-9.amzn2023.0.2 amazonlinux 36 k perl-lib x86_64 0.65-477.amzn2023.0.6 amazonlinux 15 k Transaction Summary ================================================================================================================================================================================================================ Install 8 Packages Total download size: 7.1 M Installed size: 34 M Downloading Packages: (1/8): git-2.40.1-1.amzn2023.0.3.x86_64.rpm 1.0 MB/s | 54 kB 00:00 (2/8): perl-Error-0.17029-5.amzn2023.0.2.noarch.rpm 1.2 MB/s | 41 kB 00:00 (3/8): perl-File-Find-1.37-477.amzn2023.0.6.noarch.rpm 937 kB/s | 26 kB 00:00 (4/8): perl-Git-2.40.1-1.amzn2023.0.3.noarch.rpm 1.7 MB/s | 42 kB 00:00 (5/8): git-core-2.40.1-1.amzn2023.0.3.x86_64.rpm 26 MB/s | 4.3 MB 00:00 (6/8): perl-TermReadKey-2.38-9.amzn2023.0.2.x86_64.rpm 1.4 MB/s | 36 kB 00:00 (7/8): perl-lib-0.65-477.amzn2023.0.6.x86_64.rpm 739 kB/s | 15 kB 00:00 (8/8): git-core-doc-2.40.1-1.amzn2023.0.3.noarch.rpm 12 MB/s | 2.6 MB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 26 MB/s | 7.1 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : git-core-2.40.1-1.amzn2023.0.3.x86_64 1/8 Installing : git-core-doc-2.40.1-1.amzn2023.0.3.noarch 2/8 Installing : perl-lib-0.65-477.amzn2023.0.6.x86_64 3/8 Installing : perl-TermReadKey-2.38-9.amzn2023.0.2.x86_64 4/8 Installing : perl-File-Find-1.37-477.amzn2023.0.6.noarch 5/8 Installing : perl-Error-1:0.17029-5.amzn2023.0.2.noarch 6/8 Installing : perl-Git-2.40.1-1.amzn2023.0.3.noarch 7/8 Installing : git-2.40.1-1.amzn2023.0.3.x86_64 8/8 Running scriptlet: git-2.40.1-1.amzn2023.0.3.x86_64 8/8 Verifying : git-2.40.1-1.amzn2023.0.3.x86_64 1/8 Verifying : git-core-2.40.1-1.amzn2023.0.3.x86_64 2/8 Verifying : git-core-doc-2.40.1-1.amzn2023.0.3.noarch 3/8 Verifying : perl-Error-1:0.17029-5.amzn2023.0.2.noarch 4/8 Verifying : perl-File-Find-1.37-477.amzn2023.0.6.noarch 5/8 Verifying : perl-Git-2.40.1-1.amzn2023.0.3.noarch 6/8 Verifying : perl-TermReadKey-2.38-9.amzn2023.0.2.x86_64 7/8 Verifying : perl-lib-0.65-477.amzn2023.0.6.x86_64 8/8 Installed: git-2.40.1-1.amzn2023.0.3.x86_64 git-core-2.40.1-1.amzn2023.0.3.x86_64 git-core-doc-2.40.1-1.amzn2023.0.3.noarch perl-Error-1:0.17029-5.amzn2023.0.2.noarch perl-File-Find-1.37-477.amzn2023.0.6.noarch perl-Git-2.40.1-1.amzn2023.0.3.noarch perl-TermReadKey-2.38-9.amzn2023.0.2.x86_64 perl-lib-0.65-477.amzn2023.0.6.x86_64 Complete! [ec2-user@ip-10-0-3-220 ~]$ git --version git version 2.40.1
# 실습 코드 git clone git clone https://github.com/strongjz/Networking-and-Kubernetes.git
더보기[ec2-user@ip-10-0-3-220 ~]$ gh repo clone strongjz/Networking-and-Kubernetes -bash: gh: command not found [ec2-user@ip-10-0-3-220 ~]$ git clone https://github.com/strongjz/Networking-and-Kubernetes.git Cloning into 'Networking-and-Kubernetes'... remote: Enumerating objects: 266, done. remote: Counting objects: 100% (266/266), done. remote: Compressing objects: 100% (181/181), done. remote: Total 266 (delta 104), reused 207 (delta 53), pack-reused 0 (from 0) Receiving objects: 100% (266/266), 4.20 MiB | 39.82 MiB/s, done. Resolving deltas: 100% (104/104), done. [ec2-user@ip-10-0-3-220 ~]$ ls Networking-and-Kubernetes [ec2-user@ip-10-0-3-220 ~]$ cd Networking-and-Kubernetes/ [ec2-user@ip-10-0-3-220 Networking-and-Kubernetes]$ ls -al total 40 drwxr-xr-x. 9 ec2-user ec2-user 155 Jan 7 05:06 . drwx------. 4 ec2-user ec2-user 107 Jan 7 05:06 .. drwxr-xr-x. 8 ec2-user ec2-user 163 Jan 7 05:06 .git -rw-r--r--. 1 ec2-user ec2-user 305 Jan 7 05:06 .gitignore -rw-r--r--. 1 ec2-user ec2-user 447 Jan 7 05:06 README.md drwxr-xr-x. 3 ec2-user ec2-user 59 Jan 7 05:06 chapter-1 drwxr-xr-x. 2 ec2-user ec2-user 23 Jan 7 05:06 chapter-2 drwxr-xr-x. 4 ec2-user ec2-user 106 Jan 7 05:06 chapter-3 drwxr-xr-x. 2 ec2-user ec2-user 16384 Jan 7 05:06 chapter-4 drwxr-xr-x. 2 ec2-user ec2-user 16384 Jan 7 05:06 chapter-5 drwxr-xr-x. 3 ec2-user ec2-user 34 Jan 7 05:06 chapter-6 [ec2-user@ip-10-0-3-220 Networking-and-Kubernetes]$
# Amazon Linux 2023 - Go 설치 sudo dnf install golang -y go version
더보기[ec2-user@ip-10-0-3-220 chapter-1]$ sudo dnf install golang -y Last metadata expiration check: 0:05:40 ago on Tue Jan 7 05:03:50 2025. Dependencies resolved. ================================================================================================================================================================================================================ Package Architecture Version Repository Size ================================================================================================================================================================================================================ Installing: golang x86_64 1.22.7-1.amzn2023.0.1 amazonlinux 661 k Installing dependencies: annobin-docs noarch 10.93-1.amzn2023.0.1 amazonlinux 92 k annobin-plugin-gcc x86_64 10.93-1.amzn2023.0.1 amazonlinux 887 k apr x86_64 1.7.5-1.amzn2023.0.2 amazonlinux 130 k apr-util x86_64 1.6.3-1.amzn2023.0.1 amazonlinux 98 k cpp x86_64 11.4.1-2.amzn2023.0.2 amazonlinux 10 M emacs-filesystem noarch 1:28.2-3.amzn2023.0.8 amazonlinux 10 k gc x86_64 8.0.4-5.amzn2023.0.2 amazonlinux 105 k gcc x86_64 11.4.1-2.amzn2023.0.2 amazonlinux 32 M glibc-devel x86_64 2.34-117.amzn2023.0.1 amazonlinux 33 k glibc-headers-x86 noarch 2.34-117.amzn2023.0.1 amazonlinux 434 k golang-bin x86_64 1.22.7-1.amzn2023.0.1 amazonlinux 26 M golang-src noarch 1.22.7-1.amzn2023.0.1 amazonlinux 11 M guile22 x86_64 2.2.7-2.amzn2023.0.3 amazonlinux 6.4 M kernel-headers x86_64 6.1.119-129.201.amzn2023 amazonlinux 1.4 M libmpc x86_64 1.2.1-2.amzn2023.0.2 amazonlinux 62 k libserf x86_64 1.3.9-23.amzn2023.0.3 amazonlinux 58 k libtool-ltdl x86_64 2.4.7-1.amzn2023.0.3 amazonlinux 38 k libxcrypt-devel x86_64 4.4.33-7.amzn2023 amazonlinux 32 k make x86_64 1:4.3-5.amzn2023.0.2 amazonlinux 534 k subversion-libs x86_64 1.14.2-5.amzn2023.0.3 amazonlinux 1.5 M utf8proc x86_64 2.6.1-2.amzn2023.0.2 amazonlinux 80 k Installing weak dependencies: apr-util-openssl x86_64 1.6.3-1.amzn2023.0.1 amazonlinux 17 k mercurial x86_64 5.7.1-1.amzn2023.0.3 amazonlinux 4.9 M subversion x86_64 1.14.2-5.amzn2023.0.3 amazonlinux 1.0 M Transaction Summary ================================================================================================================================================================================================================ Install 25 Packages Total download size: 98 M Installed size: 389 M Downloading Packages: (1/25): annobin-docs-10.93-1.amzn2023.0.1.noarch.rpm 0% [ ] --- B/s | 0 B --:-- ETA (1/25): apr-1.7.5-1.amzn2023.0.2.x86_64.rpm 2.3 MB/s | 130 kB 00:00 (2/25): annobin-docs-10.93-1.amzn2023.0.1.noarch.rpm 1.5 MB/s | 92 kB 00:00 (3/25): apr-util-1.6.3-1.amzn2023.0.1.x86_64.rpm 2.6 MB/s | 98 kB 00:00 (4/25): annobin-plugin-gcc-10.93-1.amzn2023.0.1.x86_64.rpm 8.5 MB/s | 887 kB 00:00 (5/25): apr-util-openssl-1.6.3-1.amzn2023.0.1.x86_64.rpm 307 kB/s | 17 kB 00:00 (6/25): emacs-filesystem-28.2-3.amzn2023.0.8.noarch.rpm 465 kB/s | 10 kB 00:00 (7/25): gc-8.0.4-5.amzn2023.0.2.x86_64.rpm 4.6 MB/s | 105 kB 00:00 (8/25): glibc-devel-2.34-117.amzn2023.0.1.x86_64.rpm 1.1 MB/s | 33 kB 00:00 (9/25): glibc-headers-x86-2.34-117.amzn2023.0.1.noarch.rpm 13 MB/s | 434 kB 00:00 (10/25): golang-1.22.7-1.amzn2023.0.1.x86_64.rpm 11 MB/s | 661 kB 00:00 (11/25): cpp-11.4.1-2.amzn2023.0.2.x86_64.rpm 38 MB/s | 10 MB 00:00 (12/25): golang-src-1.22.7-1.amzn2023.0.1.noarch.rpm 13 MB/s | 11 MB 00:00 (13/25): golang-bin-1.22.7-1.amzn2023.0.1.x86_64.rpm 23 MB/s | 26 MB 00:01 (14/25): kernel-headers-6.1.119-129.201.amzn2023.x86_64.rpm 21 MB/s | 1.4 MB 00:00 (15/25): libmpc-1.2.1-2.amzn2023.0.2.x86_64.rpm 2.5 MB/s | 62 kB 00:00 (16/25): libserf-1.3.9-23.amzn2023.0.3.x86_64.rpm 2.7 MB/s | 58 kB 00:00 (17/25): libtool-ltdl-2.4.7-1.amzn2023.0.3.x86_64.rpm 1.3 MB/s | 38 kB 00:00 (18/25): libxcrypt-devel-4.4.33-7.amzn2023.x86_64.rpm 1.4 MB/s | 32 kB 00:00 (19/25): make-4.3-5.amzn2023.0.2.x86_64.rpm 13 MB/s | 534 kB 00:00 (20/25): guile22-2.2.7-2.amzn2023.0.3.x86_64.rpm 14 MB/s | 6.4 MB 00:00 (21/25): gcc-11.4.1-2.amzn2023.0.2.x86_64.rpm 19 MB/s | 32 MB 00:01 (22/25): subversion-1.14.2-5.amzn2023.0.3.x86_64.rpm 5.2 MB/s | 1.0 MB 00:00 (23/25): subversion-libs-1.14.2-5.amzn2023.0.3.x86_64.rpm 28 MB/s | 1.5 MB 00:00 (24/25): mercurial-5.7.1-1.amzn2023.0.3.x86_64.rpm 16 MB/s | 4.9 MB 00:00 (25/25): utf8proc-2.6.1-2.amzn2023.0.2.x86_64.rpm 1.3 MB/s | 80 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 50 MB/s | 98 MB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Running scriptlet: golang-1.22.7-1.amzn2023.0.1.x86_64 1/1 Preparing : 1/1 Installing : apr-1.7.5-1.amzn2023.0.2.x86_64 1/25 Installing : apr-util-openssl-1.6.3-1.amzn2023.0.1.x86_64 2/25 Installing : apr-util-1.6.3-1.amzn2023.0.1.x86_64 3/25 Installing : libmpc-1.2.1-2.amzn2023.0.2.x86_64 4/25 Installing : cpp-11.4.1-2.amzn2023.0.2.x86_64 5/25 Installing : libserf-1.3.9-23.amzn2023.0.3.x86_64 6/25 Installing : utf8proc-2.6.1-2.amzn2023.0.2.x86_64 7/25 Installing : subversion-libs-1.14.2-5.amzn2023.0.3.x86_64 8/25 Installing : subversion-1.14.2-5.amzn2023.0.3.x86_64 9/25 Running scriptlet: subversion-1.14.2-5.amzn2023.0.3.x86_64 9/25 Installing : libtool-ltdl-2.4.7-1.amzn2023.0.3.x86_64 10/25 Installing : kernel-headers-6.1.119-129.201.amzn2023.x86_64 11/25 Installing : golang-src-1.22.7-1.amzn2023.0.1.noarch 12/25 Installing : glibc-headers-x86-2.34-117.amzn2023.0.1.noarch 13/25 Installing : libxcrypt-devel-4.4.33-7.amzn2023.x86_64 14/25 Installing : glibc-devel-2.34-117.amzn2023.0.1.x86_64 15/25 Installing : gc-8.0.4-5.amzn2023.0.2.x86_64 16/25 Installing : guile22-2.2.7-2.amzn2023.0.3.x86_64 17/25 Installing : make-1:4.3-5.amzn2023.0.2.x86_64 18/25 Installing : gcc-11.4.1-2.amzn2023.0.2.x86_64 19/25 Running scriptlet: gcc-11.4.1-2.amzn2023.0.2.x86_64 19/25 Installing : emacs-filesystem-1:28.2-3.amzn2023.0.8.noarch 20/25 Installing : mercurial-5.7.1-1.amzn2023.0.3.x86_64 21/25 Installing : golang-1.22.7-1.amzn2023.0.1.x86_64 22/25 Installing : golang-bin-1.22.7-1.amzn2023.0.1.x86_64 23/25 Running scriptlet: golang-bin-1.22.7-1.amzn2023.0.1.x86_64 23/25 Installing : annobin-docs-10.93-1.amzn2023.0.1.noarch 24/25 Installing : annobin-plugin-gcc-10.93-1.amzn2023.0.1.x86_64 25/25 Running scriptlet: annobin-plugin-gcc-10.93-1.amzn2023.0.1.x86_64 25/25 Verifying : annobin-docs-10.93-1.amzn2023.0.1.noarch 1/25 Verifying : annobin-plugin-gcc-10.93-1.amzn2023.0.1.x86_64 2/25 Verifying : apr-1.7.5-1.amzn2023.0.2.x86_64 3/25 Verifying : apr-util-1.6.3-1.amzn2023.0.1.x86_64 4/25 Verifying : apr-util-openssl-1.6.3-1.amzn2023.0.1.x86_64 5/25 Verifying : cpp-11.4.1-2.amzn2023.0.2.x86_64 6/25 Verifying : emacs-filesystem-1:28.2-3.amzn2023.0.8.noarch 7/25 Verifying : gc-8.0.4-5.amzn2023.0.2.x86_64 8/25 Verifying : gcc-11.4.1-2.amzn2023.0.2.x86_64 9/25 Verifying : glibc-devel-2.34-117.amzn2023.0.1.x86_64 10/25 Verifying : glibc-headers-x86-2.34-117.amzn2023.0.1.noarch 11/25 Verifying : golang-1.22.7-1.amzn2023.0.1.x86_64 12/25 Verifying : golang-bin-1.22.7-1.amzn2023.0.1.x86_64 13/25 Verifying : golang-src-1.22.7-1.amzn2023.0.1.noarch 14/25 Verifying : guile22-2.2.7-2.amzn2023.0.3.x86_64 15/25 Verifying : kernel-headers-6.1.119-129.201.amzn2023.x86_64 16/25 Verifying : libmpc-1.2.1-2.amzn2023.0.2.x86_64 17/25 Verifying : libserf-1.3.9-23.amzn2023.0.3.x86_64 18/25 Verifying : libtool-ltdl-2.4.7-1.amzn2023.0.3.x86_64 19/25 Verifying : libxcrypt-devel-4.4.33-7.amzn2023.x86_64 20/25 Verifying : make-1:4.3-5.amzn2023.0.2.x86_64 21/25 Verifying : mercurial-5.7.1-1.amzn2023.0.3.x86_64 22/25 Verifying : subversion-1.14.2-5.amzn2023.0.3.x86_64 23/25 Verifying : subversion-libs-1.14.2-5.amzn2023.0.3.x86_64 24/25 Verifying : utf8proc-2.6.1-2.amzn2023.0.2.x86_64 25/25 Installed: annobin-docs-10.93-1.amzn2023.0.1.noarch annobin-plugin-gcc-10.93-1.amzn2023.0.1.x86_64 apr-1.7.5-1.amzn2023.0.2.x86_64 apr-util-1.6.3-1.amzn2023.0.1.x86_64 apr-util-openssl-1.6.3-1.amzn2023.0.1.x86_64 cpp-11.4.1-2.amzn2023.0.2.x86_64 emacs-filesystem-1:28.2-3.amzn2023.0.8.noarch gc-8.0.4-5.amzn2023.0.2.x86_64 gcc-11.4.1-2.amzn2023.0.2.x86_64 glibc-devel-2.34-117.amzn2023.0.1.x86_64 glibc-headers-x86-2.34-117.amzn2023.0.1.noarch golang-1.22.7-1.amzn2023.0.1.x86_64 golang-bin-1.22.7-1.amzn2023.0.1.x86_64 golang-src-1.22.7-1.amzn2023.0.1.noarch guile22-2.2.7-2.amzn2023.0.3.x86_64 kernel-headers-6.1.119-129.201.amzn2023.x86_64 libmpc-1.2.1-2.amzn2023.0.2.x86_64 libserf-1.3.9-23.amzn2023.0.3.x86_64 libtool-ltdl-2.4.7-1.amzn2023.0.3.x86_64 libxcrypt-devel-4.4.33-7.amzn2023.x86_64 make-1:4.3-5.amzn2023.0.2.x86_64 mercurial-5.7.1-1.amzn2023.0.3.x86_64 subversion-1.14.2-5.amzn2023.0.3.x86_64 subversion-libs-1.14.2-5.amzn2023.0.3.x86_64 utf8proc-2.6.1-2.amzn2023.0.2.x86_64 Complete! [ec2-user@ip-10-0-3-220 chapter-1]$ go version go version go1.22.7 linux/amd64
# Go HTTP 서버 실행 cd ./Networking-and-Kubernetes/chapter-1/ go run web-server.go
더보기[ec2-user@ip-10-0-3-220 ~]$ cd ./Networking-and-Kubernetes/chapter-1/ [ec2-user@ip-10-0-3-220 chapter-1]$ ls -al total 20 drwxr-xr-x. 3 ec2-user ec2-user 59 Jan 7 05:06 . drwxr-xr-x. 9 ec2-user ec2-user 155 Jan 7 05:06 .. -rw-r--r--. 1 ec2-user ec2-user 16021 Jan 7 05:06 README.md drwxr-xr-x. 2 ec2-user ec2-user 50 Jan 7 05:06 vagrant -rw-r--r--. 1 ec2-user ec2-user 212 Jan 7 05:06 web-server.go [ec2-user@ip-10-0-3-220 chapter-1]$ go run web-server.go
curl localhost:8080 -vvv
더보기[ec2-user@ip-10-0-3-220 ~]$ curl localhost:8080 -vvv * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > GET / HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.5.0 > Accept: */* > < HTTP/1.1 200 OK < Date: Tue, 07 Jan 2025 05:14:18 GMT < Content-Length: 5 < Content-Type: text/plain; charset=utf-8 < * Connection #0 to host localhost left intact Hello[ec2-user@ip-10-0-3-220 ~]$
3. 리눅스에서의 네트워크 연결 처리
소켓 검사
# Go 서버 백그라운드 실행 go run web-server.go & # Go 서버 PID 확인 ps aux | grep web-server # Go 서버 PID를 Bash 변수로 선언 GO_SERVER_PID=29740 echo $GO_SERVER_PID # Go 서버 FD확인 ls -lah /proc/$GO_SERVER_PID/fd
더보기[ec2-user@ip-10-0-3-220 chapter-1]$ go run web-server.go & [2] 29933 [ec2-user@ip-10-0-3-220 chapter-1]$ ps aux | grep web-server ec2-user 29699 0.0 0.4 1237928 16112 pts/0 Tl 05:13 0:00 go run web-server.go ec2-user 29740 0.0 0.1 1610460 5740 pts/0 Tl 05:13 0:00 /tmp/go-build459637264/b001/exe/web-server ec2-user 29982 0.0 0.0 222316 2052 pts/0 S+ 05:19 0:00 grep --color=auto web-server [2]- Done go run web-server.go # Go는 실행시 두개의 프로세스가 생성됨 # 실제 컴파일되어 실행되는 웹 서버 프로세스 (29740)의 PID를 사용해야 Socket FD를 볼 수 있음 [ec2-user@ip-10-0-3-220 chapter-1]$ GO_SERVER_PID=29740 [ec2-user@ip-10-0-3-220 chapter-1]$ echo $GO_SERVER_PID 29740 [ec2-user@ip-10-0-3-220 chapter-1]$ ls -lah /proc/$GO_SERVER_PID/fd total 0 dr-x------. 2 ec2-user ec2-user 0 Jan 7 05:37 . dr-xr-xr-x. 9 ec2-user ec2-user 0 Jan 7 05:13 .. lrwx------. 1 ec2-user ec2-user 64 Jan 7 05:37 0 -> /dev/pts/0 lrwx------. 1 ec2-user ec2-user 64 Jan 7 05:37 1 -> /dev/pts/0 lrwx------. 1 ec2-user ec2-user 64 Jan 7 05:37 2 -> /dev/pts/0 lrwx------. 1 ec2-user ec2-user 64 Jan 7 05:37 3 -> 'socket:[49464]' lrwx------. 1 ec2-user ec2-user 64 Jan 7 05:37 5 -> 'anon_inode:[eventpoll]' lr-x------. 1 ec2-user ec2-user 64 Jan 7 05:37 6 -> 'pipe:[49465]' l-wx------. 1 ec2-user ec2-user 64 Jan 7 05:37 7 -> 'pipe:[49465]' [ec2-user@ip-10-0-3-220 chapter-1]$
fd 설명
표준 스트림 (0, 1, 2)
0 -> /dev/pts/0 (표준 입력, stdin) 1 -> /dev/pts/0 (표준 출력, stdout) 2 -> /dev/pts/0 (표준 에러, stderr) # /dev/pts/0 : 현재 사용중인 가상 터미널(pseudo-terminal)/SSH 연결 세션 # echo "테스트" > /dev/pts/0 # 이 명령어를 실행하면 현재 터미널 화면에 "테스트"라고 출력되는 것을 볼 수 있습니다. # 숫자 0은 첫 번째 터미널 세션을 의미합니다. 새로운 터미널 창을 열 때마다 1, 2 등으로 증가합니다. # /dev/pts/1, /dev/pts/2 ... # 따라서 프로세스의 표준 입출력(stdin, stdout, stderr)이 모두 /dev/pts/0를 가리킨다는 것은 # 키보드 입력은 이 터미널에서 받고 (stdin - 0) # 일반 출력은 이 터미널에 표시되며 (stdout - 1) # 에러 메시지도 이 터미널에 표시된다 (stderr - 2) # 는 의미입니다.
epoll(5)5 -> 'anon_inode:[eventpoll]' # epoll은 Linux의 I/O 이벤트 통지 메커니즘입니다. # Go의 네트워크 서버가 클라이언트 연결을 효율적으로 모니터링하기 위해 사용합니다.
파이프 (6, 7)
lr-x------. 1 ec2-user ec2-user 64 Jan 7 05:37 6 -> 'pipe:[49465]' l-wx------. 1 ec2-user ec2-user 64 Jan 7 05:37 7 -> 'pipe:[49465]' # 같은 파이프(50183)에 대한 읽기(r-x)와 쓰기(l-wx) 디스크립터입니다. 프로세스 내부 통신에 사용됩니다.
- ls -lah /proc/<서버 프로세스>/fd 명령으로 소켓 목록 확인 가능
- 커널이 패킷을 특정 연결에 매핑
- 각 연결은 파일로 표현됨
strace를 통한 리눅스 커널 시스템 콜 조회
# Amazon Linux 2023 : strace 설치 sudo dnf install strace -y # Go 서버 빌드 > 실행 파일 생성 cd ./Networking-and-Kubernetes/chapter-1/ go build web-server.go # strace로 실행 파일을 모니터링 strace ./web-server # 네트워크 관련 시스템 콜만 보기 strace -e trace=network ./web-server # 파일 작업 관련 시스템 콜만 보기 strace -e trace=file ./web-server # 특정 시스템 콜만 보기 (예: open, socket, connect) strace -e open,socket,connect ./web-server
더보기[ec2-user@ip-10-0-3-220 chapter-1]$ strace ./web-server execve("./web-server", ["./web-server"], 0x7ffd2b799490 /* 33 vars */) = 0 brk(NULL) = 0x386b0000 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffcb11f1ee0) = -1 EINVAL (Invalid argument) access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=15603, ...}) = 0 mmap(NULL, 15603, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff12c941000 close(3) = 0 openat(AT_FDCWD, "/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=71608, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c93f000 mmap(NULL, 80456, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff12c92b000 mmap(0x7ff12c92f000, 36864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7ff12c92f000 mmap(0x7ff12c938000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7ff12c938000 mmap(0x7ff12c93b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7ff12c93b000 mmap(0x7ff12c93d000, 6728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12c93d000 close(3) = 0 openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\0\4\0\0\0\0\0"..., 832) = 832 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 pread64(3, "\4\0\0\0@\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0"..., 80, 848) = 80 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0W\17\223\370\351\266\206\7\355(2\362\333\314\341\355"..., 68, 928) = 68 fstat(3, {st_mode=S_IFREG|0755, st_size=2385736, ...}) = 0 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 mmap(NULL, 2129808, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff12c600000 mmap(0x7ff12c628000, 1527808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7ff12c628000 mmap(0x7ff12c79d000, 360448, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7ff12c79d000 mmap(0x7ff12c7f5000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f5000) = 0x7ff12c7f5000 mmap(0x7ff12c7fb000, 53136, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12c7fb000 close(3) = 0 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c928000 arch_prctl(ARCH_SET_FS, 0x7ff12c928740) = 0 set_tid_address(0x7ff12c928a10) = 31022 set_robust_list(0x7ff12c928a20, 24) = 0 rseq(0x7ff12c9290e0, 0x20, 0, 0x53053053) = 0 mprotect(0x7ff12c7f5000, 16384, PROT_READ) = 0 mprotect(0x7ff12c93b000, 4096, PROT_READ) = 0 mprotect(0x7ff12c979000, 8192, PROT_READ) = 0 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0 munmap(0x7ff12c941000, 15603) = 0 getrandom("\xf2\xbb\x48\xab\x19\xca\xdc\xd5", 8, GRND_NONBLOCK) = 8 brk(NULL) = 0x386b0000 brk(0x386d1000) = 0x386d1000 openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 read(3, "00400000-00626000 r-xp 00000000 "..., 1024) = 1024 read(3, "-p 00000000 00:00 0 \n7ff12c92800"..., 1024) = 1024 read(3, "6-64.so.2\n7ff12c97b000-7ff12c97d"..., 1024) = 440 close(3) = 0 sched_getaffinity(31022, 32, [0 1]) = 8 sched_getaffinity(0, 8192, [0 1]) = 8 openat(AT_FDCWD, "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", O_RDONLY) = 3 read(3, "2097152\n", 20) = 8 close(3) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=82674924}) = 0 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c8e8000 mmap(NULL, 131072, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c8c8000 mmap(NULL, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c500000 mmap(NULL, 8388608, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12bd00000 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff127d00000 mmap(NULL, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff107d00000 mmap(NULL, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0e7d00000 mmap(0xc000000000, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000 mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0e5d00000 madvise(0x7ff0e5d00000, 33554432, MADV_NOHUGEPAGE) = 0 mmap(NULL, 68624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c8b7000 mmap(0xc000000000, 4194304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xc000000000 mmap(0x7ff12c8c8000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12c8c8000 mmap(0x7ff12c580000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12c580000 mmap(0x7ff12c106000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff12c106000 mmap(0x7ff129d30000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff129d30000 mmap(0x7ff117e80000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff117e80000 mmap(0x7ff0f7e80000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff0f7e80000 mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0e5c00000 madvise(0x7ff0e5c00000, 1048576, MADV_NOHUGEPAGE) = 0 mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c8a7000 mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c897000 rt_sigprocmask(SIG_SETMASK, NULL, [], 8) = 0 fcntl(0, F_GETFD) = 0 fcntl(1, F_GETFD) = 0 fcntl(2, F_GETFD) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=83776469}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=83802559}) = 0 sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0 sigaltstack({ss_sp=0xc000008000, ss_flags=0, ss_size=32768}, NULL) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 gettid() = 31022 rt_sigaction(SIGHUP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGHUP, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGINT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGQUIT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGILL, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGILL, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGTRAP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGTRAP, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGABRT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGABRT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGBUS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGBUS, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGFPE, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGFPE, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGUSR1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGUSR1, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGSEGV, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSEGV, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGUSR2, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGUSR2, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPIPE, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGALRM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGALRM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGTERM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGSTKFLT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSTKFLT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGCHLD, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGURG, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGURG, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGXCPU, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGXCPU, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGXFSZ, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGXFSZ, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGVTALRM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGVTALRM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGPROF, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPROF, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGWINCH, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGIO, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGIO, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGPWR, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPWR, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGSYS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSYS, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRTMIN, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_2, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_3, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_3, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_4, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_4, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_5, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_5, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_6, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_6, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_7, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_7, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_8, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_8, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_9, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_9, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_10, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_10, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_11, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_11, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_12, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_12, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_13, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_13, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_14, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_14, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_15, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_15, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_16, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_16, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_17, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_17, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_18, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_18, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_19, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_19, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_20, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_20, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_21, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_21, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_22, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_22, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_23, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_23, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_24, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_24, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_25, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_25, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_26, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_26, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_27, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_27, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_28, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_28, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_29, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_29, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_30, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_30, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_31, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_31, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigaction(SIGRT_32, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_32, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 rt_sigaction(SIGRT_1, {sa_handler=0x7ff12c69cba0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7ff12c654de0}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7ff0e51ff000 mprotect(0x7ff0e5200000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7ff0e5bff910, parent_tid=0x7ff0e5bff910, exit_signal=0, stack=0x7ff0e51ff000, stack_size=0x9fff00, tls=0x7ff0e5bff640} => {parent_tid=[31023]}, 88) = 31023 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=88470147}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=88767895}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=88784133}) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7ff0df5ff000 mprotect(0x7ff0df600000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7ff0dffff910, parent_tid=0x7ff0dffff910, exit_signal=0, stack=0x7ff0df5ff000, stack_size=0x9fff00, tls=0x7ff0dffff640} => {parent_tid=[31024]}, 88) = 31024 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 futex(0x89a238, FUTEX_WAKE_PRIVATE, 1) = 1 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7ff0e47fe000 mprotect(0x7ff0e47ff000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7ff0e51fe910, parent_tid=0x7ff0e51fe910, exit_signal=0, stack=0x7ff0e47fe000, stack_size=0x9fff00, tls=0x7ff0e51fe640} => {parent_tid=[31025]}, 88) = 31025 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff12c857000 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7ff0debfe000 mprotect(0x7ff0debff000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7ff0df5fe910, parent_tid=0x7ff0df5fe910, exit_signal=0, stack=0x7ff0debfe000, stack_size=0x9fff00, tls=0x7ff0df5fe640} => {parent_tid=[31026]}, 88) = 31026 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 getrlimit(RLIMIT_NOFILE, {rlim_cur=65535, rlim_max=65535}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=91345443}) = 0 fcntl(0, F_GETFL) = 0x2 (flags O_RDWR) clock_gettime(CLOCK_MONOTONIC, {tv_sec=3463, tv_nsec=91501835}) = 0 futex(0xc000049948, FUTEX_WAKE_PRIVATE, 1) = 1 fcntl(1, F_GETFL) = 0x2 (flags O_RDWR) fcntl(2, F_GETFL) = 0x2 (flags O_RDWR) socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 close(3) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 4 setsockopt(4, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 bind(4, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_scope_id=0}, 28) = 0 close(4) = 0 close(3) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 openat(AT_FDCWD, "/proc/sys/net/core/somaxconn", O_RDONLY|O_CLOEXEC) = 4 fcntl(4, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE) fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 0 epoll_create1(EPOLL_CLOEXEC) = 5 pipe2([6, 7], O_NONBLOCK|O_CLOEXEC) = 0 epoll_ctl(5, EPOLL_CTL_ADD, 6, {events=EPOLLIN, data={u32=9407032, u64=9407032}}) = 0 epoll_ctl(5, EPOLL_CTL_ADD, 4, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=4267704321, u64=9219198866214092801}}) = 0 read(4, "4096\n", 65536) = 5 read(4, "", 65531) = 0 epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc0000529ec) = 0 close(4) = 0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(8080), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use) close(3) = 0 exit_group(0) = ? +++ exited with 0 +++ [ec2-user@ip-10-0-3-220 chapter-1]$ strace -e trace=network ./web-server --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31030, si_uid=1000} --- socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 4 setsockopt(4, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 bind(4, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_scope_id=0}, 28) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(8080), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use) +++ exited with 0 +++ [ec2-user@ip-10-0-3-220 chapter-1]$ ps aux | grep web-server ec2-user 29699 0.0 0.4 1237928 16112 pts/0 Tl 05:13 0:00 go run web-server.go ec2-user 29740 0.0 0.1 1610460 5740 pts/0 Tl 05:13 0:00 /tmp/go-build459637264/b001/exe/web-server ec2-user 31096 0.0 0.0 222316 2028 pts/0 S+ 05:47 0:00 grep --color=auto web-server [ec2-user@ip-10-0-3-220 chapter-1]$ kill -9 kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] [ec2-user@ip-10-0-3-220 chapter-1]$ kill -9 29699 [ec2-user@ip-10-0-3-220 chapter-1]$ kill -9 29740 -bash: kill: (29740) - No such process [1] Killed go run web-server.go [ec2-user@ip-10-0-3-220 chapter-1]$ [ec2-user@ip-10-0-3-220 chapter-1]$ strace ./web-server execve("./web-server", ["./web-server"], 0x7ffef65b3d80 /* 33 vars */) = 0 brk(NULL) = 0x154a4000 arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdfdb7f390) = -1 EINVAL (Invalid argument) access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=15603, ...}) = 0 mmap(NULL, 15603, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f45cb491000 close(3) = 0 openat(AT_FDCWD, "/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=71608, ...}) = 0 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb48f000 mmap(NULL, 80456, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f45cb47b000 mmap(0x7f45cb47f000, 36864, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x7f45cb47f000 mmap(0x7f45cb488000, 12288, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd000) = 0x7f45cb488000 mmap(0x7f45cb48b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x7f45cb48b000 mmap(0x7f45cb48d000, 6728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45cb48d000 close(3) = 0 openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\0\4\0\0\0\0\0"..., 832) = 832 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 pread64(3, "\4\0\0\0@\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0"..., 80, 848) = 80 pread64(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0W\17\223\370\351\266\206\7\355(2\362\333\314\341\355"..., 68, 928) = 68 fstat(3, {st_mode=S_IFREG|0755, st_size=2385736, ...}) = 0 pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784 mmap(NULL, 2129808, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f45cb200000 mmap(0x7f45cb228000, 1527808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7f45cb228000 mmap(0x7f45cb39d000, 360448, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f45cb39d000 mmap(0x7f45cb3f5000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f5000) = 0x7f45cb3f5000 mmap(0x7f45cb3fb000, 53136, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45cb3fb000 close(3) = 0 mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb478000 arch_prctl(ARCH_SET_FS, 0x7f45cb478740) = 0 set_tid_address(0x7f45cb478a10) = 31100 set_robust_list(0x7f45cb478a20, 24) = 0 rseq(0x7f45cb4790e0, 0x20, 0, 0x53053053) = 0 mprotect(0x7f45cb3f5000, 16384, PROT_READ) = 0 mprotect(0x7f45cb48b000, 4096, PROT_READ) = 0 mprotect(0x7f45cb4c9000, 8192, PROT_READ) = 0 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0 munmap(0x7f45cb491000, 15603) = 0 getrandom("\xc3\xed\xda\xfc\x2c\x93\xfe\x52", 8, GRND_NONBLOCK) = 8 brk(NULL) = 0x154a4000 brk(0x154c5000) = 0x154c5000 openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3 prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 read(3, "00400000-00626000 r-xp 00000000 "..., 1024) = 1024 read(3, "-p 00000000 00:00 0 \n7f45cb47800"..., 1024) = 1024 read(3, "6-64.so.2\n7f45cb4cb000-7f45cb4cd"..., 1024) = 440 close(3) = 0 sched_getaffinity(31100, 32, [0 1]) = 8 sched_getaffinity(0, 8192, [0 1]) = 8 openat(AT_FDCWD, "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", O_RDONLY) = 3 read(3, "2097152\n", 20) = 8 close(3) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=903066150}) = 0 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb438000 mmap(NULL, 131072, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb418000 mmap(NULL, 1048576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb100000 mmap(NULL, 8388608, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45ca900000 mmap(NULL, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45c6900000 mmap(NULL, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45a6900000 mmap(NULL, 536870912, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4586900000 mmap(0xc000000000, 67108864, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xc000000000 mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4584900000 madvise(0x7f4584900000, 33554432, MADV_NOHUGEPAGE) = 0 mmap(NULL, 68624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45848ef000 mmap(0xc000000000, 4194304, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xc000000000 mmap(0x7f45cb418000, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45cb418000 mmap(0x7f45cb180000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45cb180000 mmap(0x7f45cad06000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45cad06000 mmap(0x7f45c8930000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45c8930000 mmap(0x7f45b6a80000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f45b6a80000 mmap(0x7f4596a80000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4596a80000 mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45847ef000 madvise(0x7f45847ef000, 1048576, MADV_NOHUGEPAGE) = 0 mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45cb408000 mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f45847df000 rt_sigprocmask(SIG_SETMASK, NULL, [], 8) = 0 fcntl(0, F_GETFD) = 0 fcntl(1, F_GETFD) = 0 fcntl(2, F_GETFD) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=906378557}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=906502025}) = 0 sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0 sigaltstack({ss_sp=0xc000008000, ss_flags=0, ss_size=32768}, NULL) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 gettid() = 31100 rt_sigaction(SIGHUP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGHUP, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGINT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGINT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGQUIT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGQUIT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGILL, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGILL, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGTRAP, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGTRAP, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGABRT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGABRT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGBUS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGBUS, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGFPE, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGFPE, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGUSR1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGUSR1, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGSEGV, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSEGV, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGUSR2, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGUSR2, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGPIPE, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPIPE, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGALRM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGALRM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGTERM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGSTKFLT, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSTKFLT, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGCHLD, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGURG, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGURG, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGXCPU, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGXCPU, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGXFSZ, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGXFSZ, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGVTALRM, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGVTALRM, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGPROF, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPROF, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGWINCH, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGWINCH, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGIO, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGIO, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGPWR, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGPWR, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGSYS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGSYS, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRTMIN, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_1, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_2, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_3, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_3, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_4, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_4, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_5, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_5, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_6, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_6, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_7, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_7, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_8, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_8, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_9, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_9, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_10, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_10, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_11, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_11, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_12, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_12, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_13, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_13, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_14, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_14, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_15, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_15, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_16, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_16, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_17, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_17, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_18, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_18, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_19, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_19, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_20, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_20, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_21, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_21, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_22, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_22, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_23, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_23, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_24, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_24, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_25, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_25, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_26, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_26, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_27, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_27, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_28, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_28, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_29, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_29, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_30, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_30, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_31, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_31, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigaction(SIGRT_32, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 rt_sigaction(SIGRT_32, {sa_handler=0x46f7a0, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 rt_sigaction(SIGRT_1, {sa_handler=0x7f45cb29cba0, sa_mask=[], sa_flags=SA_RESTORER|SA_ONSTACK|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f45cb254de0}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f4583dde000 mprotect(0x7f4583ddf000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f45847de910, parent_tid=0x7f45847de910, exit_signal=0, stack=0x7f4583dde000, stack_size=0x9fff00, tls=0x7f45847de640} => {parent_tid=[31101]}, 88) = 31101 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=924311921}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 --- SIGURG {si_signo=SIGURG, si_code=SI_TKILL, si_pid=31100, si_uid=1000} --- rt_sigreturn({mask=[]}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=926033512}) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f45833dd000 mprotect(0x7f45833de000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f4583ddd910, parent_tid=0x7f4583ddd910, exit_signal=0, stack=0x7f45833dd000, stack_size=0x9fff00, tls=0x7f4583ddd640} => {parent_tid=[31102]}, 88) = 31102 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 futex(0xc000049148, FUTEX_WAKE_PRIVATE, 1) = 1 sched_yield() = 0 futex(0x89a238, FUTEX_WAKE_PRIVATE, 1) = 0 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f458339d000 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=927175426}) = 0 futex(0xc000049148, FUTEX_WAKE_PRIVATE, 1) = 1 futex(0xc000049148, FUTEX_WAKE_PRIVATE, 1) = 1 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f458299c000 mprotect(0x7f458299d000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f458339c910, parent_tid=0x7f458339c910, exit_signal=0, stack=0x7f458299c000, stack_size=0x9fff00, tls=0x7f458339c640} => {parent_tid=[31103]}, 88) = 31103 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 getrlimit(RLIMIT_NOFILE, {rlim_cur=65535, rlim_max=65535}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=930601422}) = 0 fcntl(0, F_GETFL) = 0x2 (flags O_RDWR) clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=930733180}) = 0 futex(0xc000049148, FUTEX_WAKE_PRIVATE, 1) = 1 mmap(NULL, 262144, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f458295c000 fcntl(1, F_GETFL) = 0x2 (flags O_RDWR) fcntl(2, F_GETFL) = 0x2 (flags O_RDWR) socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 close(3) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_TCP) = 4 setsockopt(4, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 bind(4, {sa_family=AF_INET6, sin6_port=htons(0), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::ffff:127.0.0.1", &sin6_addr), sin6_scope_id=0}, 28) = 0 close(4) = 0 close(3) = 0 socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 3 setsockopt(3, SOL_IPV6, IPV6_V6ONLY, [0], 4) = 0 openat(AT_FDCWD, "/proc/sys/net/core/somaxconn", O_RDONLY|O_CLOEXEC) = 4 fcntl(4, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE) fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 0 epoll_create1(EPOLL_CLOEXEC) = 5 pipe2([6, 7], O_NONBLOCK|O_CLOEXEC) = 0 epoll_ctl(5, EPOLL_CTL_ADD, 6, {events=EPOLLIN, data={u32=9407032, u64=9407032}}) = 0 epoll_ctl(5, EPOLL_CTL_ADD, 4, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=245366785, u64=9170879797211955201}}) = 0 read(4, "4096\n", 65536) = 5 read(4, "", 65531) = 0 epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc0000579ec) = 0 close(4) = 0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 bind(3, {sa_family=AF_INET6, sin6_port=htons(8080), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_scope_id=0}, 28) = 0 listen(3, 4096) = 0 epoll_ctl(5, EPOLL_CTL_ADD, 3, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=245366786, u64=9170879797211955202}}) = 0 getsockname(3, {sa_family=AF_INET6, sin6_port=htons(8080), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::", &sin6_addr), sin6_scope_id=0}, [112 => 28]) = 0 accept4(3, 0xc000057afc, [112], SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable) epoll_pwait(5, [], 128, 0, NULL, 0) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3562, tv_nsec=934790159}) = 0 epoll_pwait(5,
# curl할 경우, system call strace [ec2-user@ip-10-0-3-220 ~]$ curl localhost:8080 -vvv
더보기epoll_pwait(5, [{events=EPOLLIN, data={u32=245366786, u64=9170879797211955202}}], 128, -1, NULL, 0) = 1 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=604407809}) = 0 futex(0x89a320, FUTEX_WAKE_PRIVATE, 1) = 1 accept4(3, {sa_family=AF_INET6, sin6_port=htons(49400), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [112 => 28], SOCK_CLOEXEC|SOCK_NONBLOCK) = 4 epoll_ctl(5, EPOLL_CTL_ADD, 4, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=229113857, u64=9170879797195702273}}) = 0 getsockname(4, {sa_family=AF_INET6, sin6_port=htons(8080), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, [112 => 28]) = 0 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0 setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0 setsockopt(4, SOL_TCP, TCP_KEEPINTVL, [15], 4) = 0 setsockopt(4, SOL_TCP, TCP_KEEPIDLE, [15], 4) = 0 clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=834124578}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=604723185}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=604749986}) = 0 futex(0xc000049148, FUTEX_WAKE_PRIVATE, 1) = 1 accept4(3, 0xc000057afc, [112], SOCK_CLOEXEC|SOCK_NONBLOCK) = -1 EAGAIN (Resource temporarily unavailable) clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=834327376}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=604921058}) = 0 read(4, "GET / HTTP/1.1\r\nHost: localhost:"..., 4096) = 77 clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=834493000}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=605082206}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=605103777}) = 0 rt_sigprocmask(SIG_SETMASK, ~[RTMIN RT_1], [], 8) = 0 mmap(NULL, 10489856, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f4581f5b000 mprotect(0x7f4581f5c000, 10485760, PROT_READ|PROT_WRITE) = 0 rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0 clone3({flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, child_tid=0x7f458295b910, parent_tid=0x7f458295b910, exit_signal=0, stack=0x7f4581f5b000, stack_size=0x9fff00, tls=0x7f458295b640} => {parent_tid=[31166]}, 88) = 31166 rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=835184795}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=605850770}) = 0 write(4, "HTTP/1.1 200 OK\r\nDate: Tue, 07 J"..., 121) = 121 clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=835941833}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=606575406}) = 0 read(4, "", 4096) = 0 epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc00014f914) = 0 close(4) = 0 clock_gettime(CLOCK_REALTIME, {tv_sec=1736228983, tv_nsec=836255457}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=606865626}) = 0 clock_gettime(CLOCK_MONOTONIC, {tv_sec=3668, tv_nsec=606964570}) = 0 futex(0x899140, FUTEX_WAIT_PRIVATE, 0, NULL
1. 연결 수락 단계
#### 1. 연결 수락 단계 #### # epoll을 통해 새로운 연결 요청을 감지 epoll_pwait(5, [{events=EPOLLIN, data={...}}], 128, -1, NULL, 0) = 1 # accept4로 IPv6 소켓(::1, localhost)의 49400 포트에서 들어온 연결을 수락 accept4(3, {sa_family=AF_INET6, sin6_port=htons(49400), ...}, [112 => 28], SOCK_CLOEXEC|SOCK_NONBLOCK) = 4 #### 2. 소켓 설정 #### # TCP_NODELAY 활성화 (Nagle 알고리즘 비활성화) setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0 # Keep-alive 설정 활성화 setsockopt(4, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0 # Keep-alive 간격을 15초로 설정 setsockopt(4, SOL_TCP, TCP_KEEPINTVL, [15], 4) = 0 setsockopt(4, SOL_TCP, TCP_KEEPIDLE, [15], 4) = 0 #### 3. 요청 읽기 #### # 클라이언트로부터 HTTP GET 요청을 읽음 read(4, "GET / HTTP/1.1\r\nHost: localhost:"..., 4096) = 77 #### 4. 응답 전송 #### # 클라이언트에게 HTTP 200 OK 응답을 전송 write(4, "HTTP/1.1 200 OK\r\nDate: Tue, 07 J"..., 121) = 121 #### 5. 연결 종료 #### # 더 이상 읽을 데이터가 없음을 확인 # epoll에서 소켓 제거 # 소켓 연결 종료 read(4, "", 4096) = 0 epoll_ctl(5, EPOLL_CTL_DEL, 4, 0xc00014f914) = 0 close(4) = 0
다음글이전글이전 글이 없습니다.댓글
스킨 업데이트 안내
현재 이용하고 계신 스킨의 버전보다 더 높은 최신 버전이 감지 되었습니다. 최신버전 스킨 파일을 다운로드 받을 수 있는 페이지로 이동하시겠습니까?
("아니오" 를 선택할 시 30일 동안 최신 버전이 감지되어도 모달 창이 표시되지 않습니다.)