Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
シグナル(Unix)と仲良くなる
Search
ryuichi1208
October 02, 2025
200
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
そのasync、止まってない? ”鉄板”イベントループ ブロッキング処理検出術
ryuichi1208
1
2.2k
AIでサービス運用はどう変わるのか
ryuichi1208
0
200
入門 再発防止策
ryuichi1208
17
7.7k
障害対応からの学びと体制づくり
ryuichi1208
0
7
金曜日デプロイ、するかしないか.pdf
ryuichi1208
1
91
会話で作る信頼性
ryuichi1208
0
200
LiteLLM Proxyの紹介
ryuichi1208
1
25
AI前提のサービス運用について再考する
ryuichi1208
6
1.5k
A Shallow Dive into the World of TCP
ryuichi1208
1
700
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Un-Boring Meetings
codingconduct
0
430
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
520
A Soul's Torment
seathinner
8
3.6k
The Invisible Side of Design
smashingmag
301
52k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
460
The World Runs on Bad Software
bkeepers
PRO
72
12k
Making Projects Easy
brettharned
120
6.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
GraphQLとの向き合い方2022年版
quramy
50
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Transcript
シグナル (Unix)と仲良くなる Tamachi.sre#1 渡部 龍一
自己紹介 • 名前: 渡部龍一 • 所属: 株式会社IVRy SRE • Tamachi.sreスタッフ
• 好きなシステム管理コマンド: killall5
話したいことが大量にあるので今日は入門的な話をします
シグナル(Unix) • プロセスに対し、非同期でイベントの発生を通知するための機構 • カーネルからプロセスへ、またはあるプロセスから別のプロセスへ送れる • シグナルはソフトウェア割り込みとも呼ばれる ◦ 通常の実行を一時的に中断して特定の処理を実行することもできる
馴染み深いところだと • プロセスの強制終了 ◦ kill ${PID} ◦ Ctrl+C • Graceful
Shutdown • Graceful Restart
Graceful Shutdown • 新規リクエストの受付を止め、進行中だけを安全に終わらせ、状態や 接続・キューを破壊せずにプロセスを落とす • これがないとデプロイの度に処理中のリクエストが突然終了してしまっ てユーザー体験が悪くなる
Graceful Shutdown(実装のk8sでの例) • kubectl delete podを実行するとPodにdeletionTimestamp を付与 • kubelet がそれを検知し、各コンテナに対して終了処理を実行
• コンテナランタイムがコンテナの PID1 に SIGTERM を配送 • 新規のリクエストの受付を停止 • 期限までに終了しなければ SIGKILL(強制終了)
Graceful Shutdown(シグナルハンドラ) • SIGTERMを受け取ったら勝手にGracefulにShutdownされるわけで はない • SIGTERMを受けたプロセスの“デフォルト動作”は終了 • シグナルを補足して処理を継続させる必要がある •
シグナルハンドラ ◦ シグナルを受け取ったときに即座に呼ばれるコールバック
None
完全に理解した
とはならない
次回以降 • シグナル配送の仕組み • シグナルブロック • SIGKILLでも殺せないプロセス • リアルタイムシグナル •
シグナル送信元の特定方法 • SIGPIPEの怖い話 • SIGSEGV/SIGABRT
待てない!
おすすめの書籍
None