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
48
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
シグナル(Unix)と仲良くなる
ryuichi1208
October 02, 2025
More Decks by ryuichi1208
See All by ryuichi1208
AIでサービス運用はどう変わるのか
ryuichi1208
0
150
入門 再発防止策
ryuichi1208
17
7.3k
金曜日デプロイ、するかしないか.pdf
ryuichi1208
1
75
会話で作る信頼性
ryuichi1208
0
180
AI前提のサービス運用について再考する
ryuichi1208
6
1.5k
A Shallow Dive into the World of TCP
ryuichi1208
1
680
入門リトライ
ryuichi1208
20
8.3k
超入門SRE 2025
ryuichi1208
4
1.5k
Goで作って学ぶWebSocket
ryuichi1208
5
4.3k
Featured
See All Featured
A Soul's Torment
seathinner
6
3k
Building AI with AI
inesmontani
PRO
1
1.1k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Abbi's Birthday
coloredviolet
3
8.5k
Six Lessons from altMBA
skipperchong
29
4.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
420
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
HDC tutorial
michielstock
2
730
Raft: Consensus for Rubyists
vanstee
141
7.6k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
180
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.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