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
daemontools-kobanashi
Search
yudoufu
August 11, 2015
Technology
0
71
daemontools-kobanashi
yudoufu
August 11, 2015
Tweet
Share
More Decks by yudoufu
See All by yudoufu
Project開始後に導入するAssetsの自動共有
yudoufu
2
3.4k
Drink Meetup with Mercari #36 Souzoh編
yudoufu
0
990
Casualにインフラテストへ入門した話
yudoufu
2
4k
5分で知るGo言語
yudoufu
0
160
Other Decks in Technology
See All in Technology
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
140
"とにかくやってみる"で始めるAWS Security Hub
maimyyym
2
110
日経電子版のStoreKit2フルリニューアル
shimastripe
1
160
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
130
LINEヤフーにおけるPrerender技術の導入とその効果
narirou
2
640
The Role of Developer Relations in AI Product Success.
giftojabu1
0
160
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
230
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.5k
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
740
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
200
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
140
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
300k
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Become a Pro
speakerdeck
PRO
25
5k
Designing the Hi-DPI Web
ddemaree
280
34k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Adopting Sorbet at Scale
ufuk
73
9.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
For a Future-Friendly Web
brad_frost
175
9.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Transcript
daemontoolsখ @yudoufu 2015/08/11 ෦ษڧձ ͓ͬ͞ΜͬΆ͍Λ͠·͢
daemontoolsͬͯͬͯ͠Δʁ • αʔϏεͷdaemonӬଓԽπʔϧͱͯ͠༗໊ • ͓ͬ͞ΜΈΜͳ͓ੈʹͳͬͯΔ • ࠷ۙsupervisord ൊ;͑ͨͶ
ͦͦdaemontoolsͱ • UNIX/LinuxͷαʔϏεཧπʔϧ܈ͷ૯শ • djb࡞ • qmail / tcpserverͷ࡞ऀͰ͋Δ •
http://cr.yp.to/daemontools.html
daemontoolsͷத • daemonӬଓԽπʔϧ (svscan/supervise) • daemontoolsͬͯݴ͏ͱී௨͜ΕΛࢦ͢ • ҆શͳϩάهπʔϧ (multilog) •
αʔϏε/daemonԽͷิॿɾศརπʔϧ • ࠓ͔͜͜ΒϐοΫΞοϓͯ͠հ
daemontoolsͷิॿπʔϧ܈ • ͍͍ͪͪ໘ͩΑͶɺΛ࣮ݱͯ͘͠ΕΔখ • ୯Ͱ͑Δͷ͕ଟͯ͘UNIXత
setlock % setlock -n /path/to/hoge.lock command • command࣮ߦલʹlockΛߦ͍ɺϓϩηεͷॏ ෳىಈΛ͍Ͱ͘ΕΔ •
-n: ॏෳىಈcommand࣮ߦͤͣଈऴྃ • -N: ॏෳىಈϩοΫͷղ์Λ࣮ͬͯߦ • cronͱΈ߹Θͤͯ͏ͱศར
setlock - ༻ྫ 00 * * * * setlock -n
/var/run/cron.lock hugeprocess.sh • ͍͢͝Ͱ͔͍ॲཧΛຖ࣌Δ߹ • ສ͕Ұ࣍ͷ࣮ߦ͕࣌ؒདྷͯɺ࣍ͷϓϩηε ࣮ߦ͞Εͣऴྃ͢Δ setlock: fatal: unable to lock /var/run/cron.lock: temporary failure
setlock - ༻ྫ 00 * * * * setlock -N
/var/run/cron.lock preprocess.sh 30 * * * * setlock -N /var/run/cron.lock postprocess.sh • લॲཧͷ݁ՌΛड͚ͯޙॲཧΛ࣮ߦ͍ͨ͠ɺ ͱ͍͏ͷΛຖ࣌Δ߹ͳͲ • ಉ͡lockϑΝΠϧͳΒίϚϯυ͕ҧͬͯॲཧ Λͬͯ͘ΕΔ
envdir % envdir /path/to/env command • ୈ1ҾͰࢦఆͨ͠σΟϨΫτϦͷϑΝΠϧ Λɺڥมͱͯ͠ઃఆͯ͘͠ΕΔ
envdir - ࣮ߦྫ % cat /tmp/env/IP 192.168.1.1 % cat /tmp/env/LOGDIR
/var/log/hoge % envdir /tmp/env env | egrep "(IP|LOGIDIR)" IP=192.168.1.1 LOGDIR=/var/log/hoge • dirͷϑΝΠϧ໊Λม໊ʹɺ༰Λvalueʹ • ڥมͱεΫϦϓτΛผཧ͘͢͠ͳΔ
envuidgid % envuidgid user command • envͷ UID / GIDʹୈ1ҾͷuserΛઃఆ
• ࣮ߦϢʔβʔΛม͑ΔΘ͚͡Όͳ͍ envuidgid www-data env |egrep "(GID|UID|USER)" USER=yudoufu GID=33 UID=33
setuidgid % setuidgid user command • ࣮ߦ࣌ݖݶΛߜΓ͍ͨ߹ʹ͏ • جຊతʹroot࣮ߦͷεΫϦϓτͰ͏ •
αϒάϧʔϓΛө͠ͳ͍ͷͰͨ·ʹਏ͍ • https://github.com/bruceg/daemontools- encore • ༗ࢤ͕ͨ͠Γͯ͠Δ
softlimit % softlimit [-p… n] command • commandʹରͯ͠Ϧιʔε੍ݶΛ͔͚ΒΕΔ • ϓϩηε͝ͱͷdataηάϝϯτ੍ݶ
• ಉҰUIDͰͷϓϩηε੍ݶ • etc…
༨ஊ • εϥΠυΛmd2keyΛͬͯ࡞ͬͯΈͨ • https://github.com/k0kubun/md2key • ίϚϯυͷhighlight͍͍ײ͡ • จͷܗͬͺΓਓ͕Կͱ͔͢Δ •
·ͩେࡶʹ͋ͯ͜Ήπʔϧɺͱ͍͏ײ͡
·ͱΊ • daemontoolsͷαϙʔτπʔϧ܈ؾ͕ޮ͍ ͯͯศར