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
ryuichi1208
October 02, 2025
1
17
シグナル(Unix)と仲良くなる
ryuichi1208
October 02, 2025
Tweet
Share
More Decks by ryuichi1208
See All by ryuichi1208
会話で作る信頼性
ryuichi1208
0
130
AI前提のサービス運用について再考する
ryuichi1208
6
1.4k
A Shallow Dive into the World of TCP
ryuichi1208
1
630
入門リトライ
ryuichi1208
20
7.9k
超入門SRE 2025
ryuichi1208
4
1.5k
Goで作って学ぶWebSocket
ryuichi1208
5
4k
コード化されていない稼働中のサーバを移設_再構築する技術
ryuichi1208
20
15k
AI前提のサービス運用ってなんだろう?
ryuichi1208
9
1.9k
入門 バックアップ
ryuichi1208
22
11k
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
440
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Become a Pro
speakerdeck
PRO
31
5.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
470
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
Paper Plane
katiecoart
PRO
0
46k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.6k
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