Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
シグナル(Unix)と仲良くなる
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ryuichi1208
October 02, 2025
43
1
Share
シグナル(Unix)と仲良くなる
ryuichi1208
October 02, 2025
More Decks by ryuichi1208
See All by ryuichi1208
入門 再発防止策
ryuichi1208
16
6.5k
金曜日デプロイ、するかしないか.pdf
ryuichi1208
1
69
会話で作る信頼性
ryuichi1208
0
170
AI前提のサービス運用について再考する
ryuichi1208
6
1.4k
A Shallow Dive into the World of TCP
ryuichi1208
1
670
入門リトライ
ryuichi1208
20
8.2k
超入門SRE 2025
ryuichi1208
4
1.5k
Goで作って学ぶWebSocket
ryuichi1208
5
4.2k
コード化されていない稼働中のサーバを移設_再構築する技術
ryuichi1208
20
15k
Featured
See All Featured
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
Statistics for Hackers
jakevdp
799
230k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Optimizing for Happiness
mojombo
378
71k
Thoughts on Productivity
jonyablonski
76
5.2k
Technical Leadership for Architectural Decision Making
baasie
3
380
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
750
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
580
First, design no harm
axbom
PRO
2
1.2k
Transcript
シグナル(Unix)と仲良くなる Tamachi.sre#1
• 名前: 渡部龍一 • 所属: 株式会社IVRy SRE • Tamachi.sreスタッフ •
好きなシステム管理コマンド: killall5 自己紹介
話したいことが大量にあるので今日は入門的な話をします
• プロセスに対し、非同期でイベントの発生を通知するための機構 • カーネルからプロセスへ、またはあるプロセスから別のプロセスへ送れる • シグナルはソフトウェア割り込みとも呼ばれる ◦ 通常の実行を一時的に中断して特定の処理を実行することもできる シグナル(Unix)
• プロセスの強制終了 ◦ kill ${PID} ◦ Ctrl+C • Graceful Shutdown
• Graceful Restart 馴染み深いところだと
• 新規リクエストの受付を止め、進行中だけを安全に終わらせ、状態や 接続・キューを破壊せずにプロセスを落とす • これがないとデプロイの度に処理中のリクエストが突然終了してしまっ てユーザー体験が悪くなる Graceful Shutdown
• kubectl delete podを実行するとPodにdeletionTimestamp を付与 • kubelet がそれを検知し、各コンテナに対して終了処理を実行 • コンテナランタイムがコンテナの
PID1 に SIGTERM を配送 • 新規のリクエストの受付を停止 • 期限までに終了しなければ SIGKILL(強制終了) Graceful Shutdown(実装のk8sでの例)
• SIGTERMを受け取ったら勝手にGracefulにShutdownされるわけで はない • SIGTERMを受けたプロセスの“デフォルト動作”は終了 • シグナルを補足して処理を継続させる必要がある • シグナルハンドラ ◦
シグナルを受け取ったときに即座に呼ばれるコールバック Graceful Shutdown(シグナルハンドラ)
None
完全に理解した
とはならない
• シグナル配送の仕組み • シグナルブロック • SIGKILLでも殺せないプロセス • リアルタイムシグナル • シグナル送信元の特定方法
• SIGPIPEの怖い話 • SIGSEGV/SIGABRT 次回以降
待てない!
おすすめの書籍
None