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
33
1
Share
シグナル(Unix)と仲良くなる
ryuichi1208
October 02, 2025
More Decks by ryuichi1208
See All by ryuichi1208
会話で作る信頼性
ryuichi1208
0
150
AI前提のサービス運用について再考する
ryuichi1208
6
1.4k
A Shallow Dive into the World of TCP
ryuichi1208
1
650
入門リトライ
ryuichi1208
20
8.1k
超入門SRE 2025
ryuichi1208
4
1.5k
Goで作って学ぶWebSocket
ryuichi1208
5
4.1k
コード化されていない稼働中のサーバを移設_再構築する技術
ryuichi1208
20
15k
AI前提のサービス運用ってなんだろう?
ryuichi1208
9
2k
入門 バックアップ
ryuichi1208
22
11k
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
340
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Embracing the Ebb and Flow
colly
88
5k
Optimizing for Happiness
mojombo
378
71k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
The SEO identity crisis: Don't let AI make you average
varn
0
460
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
Prompt Engineering for Job Search
mfonobong
0
290
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
110
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
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