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
BedrockとLambdaで作る リアルタイム進行型推理ゲーム
kawametho
0
170
並行性の問題を防げ!実践トランザクション入門
occhi
0
240
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
180
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
110
Snowflake Horizon Catalog と Apache Iceberg で作る オープンなデータ基盤
kitagawaz
0
400
私の推しは「聞いてから進む」AIです -AI-DLCに一人でアプリを作らせた話
yama3133
1
160
AgentCoreで実践するハーネスエンジニアリング
yakumo
1
260
Meet AgentCore Identity Consent Portal
hironobuiga
3
180
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
150
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
140
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
460
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
330
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Scaling GitHub
holman
464
140k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
620
Visualization
eitanlees
153
17k
Odyssey Design
rkendrick25
PRO
2
850
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
The World Runs on Bad Software
bkeepers
PRO
72
12k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
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ͷαϙʔτπʔϧ܈ؾ͕ޮ͍ ͯͯศར