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
210
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.3k
AIでサービス運用はどう変わるのか
ryuichi1208
0
220
入門 再発防止策
ryuichi1208
17
7.9k
SREの組織構造と実践.
ryuichi1208
0
320
信頼性・システムの観測・障害対応
ryuichi1208
1
11
障害対応からの学びと体制づくり
ryuichi1208
0
1.2k
金曜日デプロイ、するかしないか.pdf
ryuichi1208
1
490
会話で作る信頼性
ryuichi1208
0
200
LiteLLM Proxyの紹介
ryuichi1208
1
95
Featured
See All Featured
Speed Design
sergeychernyshev
33
2.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
GitHub's CSS Performance
jonrohan
1033
470k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
My Coaching Mixtape
mlcsv
0
360
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
550
We Have a Design System, Now What?
morganepeng
55
8.4k
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