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
140
入門 再発防止策
ryuichi1208
17
7.3k
金曜日デプロイ、するかしないか.pdf
ryuichi1208
1
75
会話で作る信頼性
ryuichi1208
0
180
AI前提のサービス運用について再考する
ryuichi1208
6
1.4k
A Shallow Dive into the World of TCP
ryuichi1208
1
670
入門リトライ
ryuichi1208
20
8.3k
超入門SRE 2025
ryuichi1208
4
1.5k
Goで作って学ぶWebSocket
ryuichi1208
5
4.3k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Mobile First: as difficult as doing things right
swwweet
225
10k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
55k
The agentic SEO stack - context over prompts
schlessera
0
830
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Done Done
chrislema
186
16k
エンジニアに許された特別な時間の終わり
watany
107
250k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
240
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
400
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