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
110
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
VPCでもFloatingIPを使いたいんだ
y_kotani
1
140
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
170
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
190
When Token Pruning is Worse than Random: Understanding Visual Token Information in VLLMs
sansantech
PRO
0
210
hookで自作する Claude Code の「実況ボード」
shinyasaita
2
270
AWSとAzureのマルチクラウド活用における強い味方___AWS_Kiroを使った二刀流スキル作成.pdf
duelist2020jp
1
160
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
410
EUDIWの枠組みを出発点に民間エコシステムの在り方を考える(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
420
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
1
280
人気商品が「ちゃんと買える」をつくる ー ECの負荷改善
ykagano
1
160
Level Up Your CDK DX: 5 Tools I’ve Been Building
gotok365
2
150
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
9
1.7k
Featured
See All Featured
We Are The Robots
honzajavorek
0
320
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Mobile First: as difficult as doing things right
swwweet
225
10k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Skip the Path - Find Your Career Trail
mkilby
1
210
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
880
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
680
The Curse of the Amulet
leimatthew05
2
14k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
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ͷαϙʔτπʔϧ܈ؾ͕ޮ͍ ͯͯศར