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
daemontools-kobanashi
Search
yudoufu
August 11, 2015
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
daemontools-kobanashi
yudoufu
August 11, 2015
More Decks by yudoufu
See All by yudoufu
Project開始後に導入するAssetsの自動共有
yudoufu
2
3.6k
Drink Meetup with Mercari #36 Souzoh編
yudoufu
0
1k
Casualにインフラテストへ入門した話
yudoufu
2
4.3k
5分で知るGo言語
yudoufu
0
180
Other Decks in Technology
See All in Technology
The kernel report
ennael
PRO
1
220
DAMOS - The Smart Cruise Control for RAM
ennael
PRO
1
110
Lambda MicroVMsが分からなすぎたので使い所を1から考えてみた
tsukuboshi
2
320
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
130
自主式軟體工廠
philipz
0
140
ファミコンでPHPを動かす / PHP on the Famicom side b
tomzoh
0
120
プラットフォームを「作る」、 チームに「入り込む」
sansantech
PRO
0
640
個別開発で終わらせない。 現場の課題をプロダクトの強さに変える StockmarkのFDE
ktkrhr
0
560
認知負荷を吸収し、プロダクトをまたぐPR Preview基盤の設計事例
taiki45
2
580
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
460
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
140
IR Today: Theory, Practice, and Agents
dtunkelang
0
330
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1.1k
Crafting Experiences
bethany
1
370
Claude Code のすすめ
schroneko
67
230k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
520
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Being A Developer After 40
akosma
91
590k
Ethics towards AI in product and experience design
skipperchong
2
410
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
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ͷαϙʔτπʔϧ܈ؾ͕ޮ͍ ͯͯศར