getwallpapers.comããã®ç»å
ç©èª
2013幎ã«ã¯ãããéè¡ãDisklessUbuntuã«åºã¥ãã·ã³ã¯ã©ã€ã¢ã³ãã䜿çšããŠããŸããã ãããã«ã¯ããã€ãã®åé¡ããããŸãããç§ã®æèŠã§ã¯ãè匱ãªãããã¯ãŒã¯ãæã€å€§èŠæš¡ãªãã©ã³ãã®ãããã¯ãŒã¯äžã§ã«ãŒãFSãããŠã³ãããããšã¯ããŸãããŸããããŸããã§ããã ãã®åŸãç§ã®è¯ãå人ã§ãã@deadrootãã·ã³ã¯ã©ã€ã¢ã³ãã®æåã®ããŒãžã§ã³ãäœæããŸãããããã¯å®å šã«ã¡ã¢ãªã«ããŒããããåäœããããã«ãããã¯ãŒã¯ã«äœãããŠã³ãããå¿ èŠã¯ãããŸããã
ãã®åŸãç§ã¯ãã®ã¯ã©ã€ã¢ã³ããç©æ¥µçã«å®æãããç§ãã¡ã®ãŠãŒã¹ã±ãŒã¹ã«ç¹æã®å€ãã®æçšãªããšãè¡ãããŸããã ãã®åŸãéè¡ã¯ééãïŒã©ã€ã»ã³ã¹ã¯åãæ¶ãããŸããïŒãã¯ã©ã€ã¢ã³ãã®ãœãŒã¹ã³ãŒãã®æ®ãã¯ç§ã®githubïŒ thunclientã«ç§»åããŸãã ã æ°åã泚æéãã«è»œãä»äžããŸããã
æè¿ãç§ã¯ãã®æãããä¿¡é Œã§ããªãã¹ã¯ãªããã®ããŒãã䜿çšããã®ã«éåžžã«äŸ¿å©ãªãœãªã¥ãŒã·ã§ã³ã«ããæ¹æ³ãæã«å ¥ããŸããïŒ
- Vagrantã¯ãéåžžã®ã¯ãŒã¯ã¹ããŒã·ã§ã³ãšããŠæ§æã§ããä»®æ³ãã·ã³ãçæããŸãã
- 1ã€ã®ã¹ã¯ãªããã§ã¯ããããã¯ãŒã¯çµç±ã§ããŠã³ããŒãããæºåãã§ããŠãããã¡ã€ã«ãããããåéãããäœåãªéšåã¯ã«ãããããŸãã
- Vagrantã¯ãä»®æ³PXEãµãŒããŒãšãããã¯ãŒã¯ã¯ã©ã€ã¢ã³ããçæããŠãçµæã®ãã«ããæ€èšŒããŸãã
äœãã§ãã
- ã¡ã¢ãªã«å®å šã«ããŒããããŠãããããæäœã®ããã«ãããã¯ãŒã¯çµç±ã§ã«ãŒãFSãããŠã³ãããå¿ èŠã¯ãããŸããã
- Ubuntuã«åºã¥ããŠæ§ç¯ãããŠãããããã»ãšãã©ãã¹ãŠã®ãœãããŠã§ã¢ãè±å¯ãªãªããžããªããã€ã³ã¹ããŒã«ã§ããäœãã足ããªãå Žåã¯ãµãŒãããŒãã£ãæ¥ç¶ã§ããŸãã ã»ãã¥ãªãã£æŽæ°ããã°ã©ã ãUbuntuã«ååãªéãã§å±ãã®ã¯ç¹ã«çŽ æŽãããããšã§ãã
- ã«ãŒãFSã®äžã«è¿œå ã®ãªãŒããŒã¬ã€ãããŠã³ãã§ããŸãã æ°ããã€ã¡ãŒãžãåéããã«ãäžéšã®ã¯ãŒã¯ã¹ããŒã·ã§ã³ã«ã®ã¿äžéšã®ãœãããŠã§ã¢ãè¿œå ã§ããŸã
- zramãå¯èœ -ã¡ã¢ãªå§çž®ãå°éã®RAMãæã€å€ãã¯ã©ã€ã¢ã³ãã«åœ¹ç«ã¡ãŸãã æ°ãããã®ã®å Žåãéåžžã¯å®³ã¯ãããŸããã
- RDPã¯ã©ã€ã¢ã³ããåããã€ãŒãžãŒãã¹ã¯ãããïŒLXDEïŒã¯ããã¯ã¹ããçµã¿ç«ãŠãããRDPãµãŒããŒã®ã¢ãã¬ã¹ãšãã©ã¡ãŒã¿ãŒã¯ããŒãæã«ãã©ã¡ãŒã¿ãŒãä»ããŠPXEãµãŒããŒããåçŽã«è»¢éãããŸãã
- æ§æå ã®1ã€ã®ãã©ã¡ãŒã¿ãŒãå€æŽãããšãäžèŠãªãœãããŠã§ã¢ãªãã§æå°éã®ã³ã³ãœãŒã«ã·ã¹ãã ãçµã¿ç«ãŠãããŸããããã¯ãã«ã¹ã¿ã ãã«ãã®åºç€ãšãªããŸãã
- ãµãŒããŒãŸãã¯ãããã¯ãŒã¯ã®åé¡ãåå ã§ããŠã³ããŒãã倱æããå Žåãé·ãéãšã©ãŒã¡ãã»ãŒãžã衚瀺ããããåèµ·åãè©Šè¡ãããŸãã 䟿å©ãªããšã«ãåé¡ãä¿®æ£ããããšãã¯ãŒã¯ã¹ããŒã·ã§ã³ã¯äžå¿ èŠãªãžã§ã¹ãã£ãŒãããã«ç«ã¡äžãããŸãã
éè¡ã§ã¯ãVNCã䜿çšããŠãŠãŒã¶ãŒã®ã·ã³ã¯ã©ã€ã¢ã³ãã«ãªã¢ãŒãæ¥ç¶ããŸããïŒ x11vnc
ã¯æ¢ã«å®è¡äžã®Xorgã»ãã·ã§ã³ã«æ¥ç¶ããŸãïŒã 誰ãããããå¿
èŠãšããããã§ã¯ãããŸããïŒéåžžãã¿ãŒããã«ãµãŒããŒäžã®RDPã»ãã·ã§ã³ã«æ¥ç¶ããèœåã§ååã§ãïŒãããã§ã¯ãå©äŸ¿æ§/ã»ãã¥ãªãã£èŠä»¶ã®ç¹ã§ãã¹ãŠãéåžžã«åå¥ã§ãã ãããã£ãŠãç§ã¯ãã®éšåãåºããŸããã§ããã
ã¢ããã°
Thinstationãå®å šã«æºè¶³ããŠããå Žåã¯ãããã䜿çšããããšããå§ãããŸããããã¯ãããå€ããããæçãããããžã§ã¯ãã§ãã ããã«ããµã€ãºã¯1.5åå°ãããçµå±ã®ãšãããæå°ã®ããªã¥ãŒã ã®ããã«ç¹å¥ã«ç ãæŸãŸãããã¢ã»ã³ããªã§ãããéåžžã®Ubuntuã§ãããã«ããŒããããŠããŸããã
ãããããã®äžã®ãœãããŠã§ã¢ã®ããŒãžã§ã³ã¯éåžžã«å€ãããããã¯ã»ãšãã©ãããŸããã RDP / Citrix / ...ã¯ã©ã€ã¢ã³ãã«å ããŠãäœãè¿œå ã®ãã®ãå¿ èŠãªå Žåã¯ãæåã§åéããå¿ èŠããããŸãããã®ãããæŽæ°ããšã«åéããå¿ èŠããããŸãã
kvapsã¯ãLTSPããããã¯ãŒã¯äžã«ãã¡ã€ã«ã·ã¹ãã ãããŠã³ãããã«squashfsã€ã¡ãŒãžãã¡ã¢ãªã«ã³ããŒããŠåäœã§ããããšãã³ã¡ã³ãã§ææããŸãããããã¯LTSP_NBD_TO_RAMå€æ°ã«ãã£ãŠæ§æãããŸãã Chrootã¯ã«ã¹ã¿ãã€ãºã«äœ¿çšãããŸãããç¹ã«ã°ã©ãã£ã«ã«ç°å¢ãšã¢ããªã±ãŒã·ã§ã³ã®ã«ã¹ã¿ãã€ãºã«ã¯ããŸã䟿å©ã§ã¯ãããŸããã ãŸããåªããæçãããããžã§ã¯ãã¯ã代æ¿æ¡ãšã¿ãªãããšãã§ããŸãã
Vagrant vs chroot
以åã®ããŒãžã§ã³ã§ã¯ãããšãã°åãThinstationãªã©ãã»ãšãã©ã®é¡äŒŒãããžã§ã¯ããšåæ§ã«chrootã䜿çšããŠããŸããã ããã¯é£ããããšã§ã¯ãããŸããããããã§ããchrootã§èµ·åãããå¥ã®ããã°ã©ã ã¯å®éã®ãã·ã³ã§èµ·ãã£ãŠããããšã«å¯Ÿå¿ããŠããŸãããã·ã¹ãã initãä»ã®ããã°ã©ã ããã³ãµãŒãã¹ãšã®çžäºäœçšã¯ãããŸããã ããã«ãVagrantã¯ãã¯ã©ã€ã¢ã³ããäœæããããã»ã¹ãå¯èœãªéãã·ã³ãã«ã«ããŸãããä»®æ³ãã·ã³ã¯éåžžã®ãã·ã³ã®ããã«æ§æãããŠããŸãã
ãã¡ãããVagrantã®äœ¿çšã«ã¯ããã€ãã®å°é£ã䌎ããŸãã
å
±æãã©ã«ããæ©èœããã«ã¯ã virtualbox-guest-utils
ãµãŒãã¹ããã·ã³äžã§å®è¡ãããŠããå¿
èŠããããŸãã ããã«ãããŒããããŒãžã£ãŒïŒ grub
ïŒãå¿
èŠã§ããããã¯ããã£ã¹ã¯ãæèŒãããã·ã³ã«ã¯å¿
èŠã§ããããããã¯ãŒã¯çµç±ã§ããŠã³ããŒãããã¯ã©ã€ã¢ã³ãã«ã¯åœ¹ã«ç«ããªããã®ã§ãã ãããã®ããã±ãŒãžã®ãã¹ãŠã®ãã¡ã€ã«ãã¢ã»ã³ããªããé€å€ããããšã§ããããã®åé¡ã解決ããŸããã ãããã£ãŠãçµæã®ç»åã®ãµã€ãºã«ã¯åœ±é¿ããŸããã
ããã«ãVagrantã«ã¯ãã·ã³ã§å®è¡ãããŠãããµã°ãå¿ èŠã§ãããçæãããããŒã§ãŠãŒã¶ãŒãèµ·åããŸãã sshããŒãšå ±ã«ãæ§æã«äœ¿çšãããvagrantãŠãŒã¶ãŒã®ããŒã ãã£ã¬ã¯ããªãã¢ã»ã³ããªããé€å€ããŸãã äœæ¥äžã«äœ¿çšãããubuntuãŠãŒã¶ãŒã®ããŒã¯ãããŒã ãã£ã¬ã¯ããªã«é 眮ã§ããŸãã
ãŸããä»äºã®ããã«ãVagrantã¯ãå®éã®ãã·ã³ã§ã¯ãšã©ãŒã«ãªããããã¯ãŒã¯ã€ã³ã¿ãŒãã§ã€ã¹èšå®ãçæããŸãã ãã«ãæã«interfaces
ãã¡ã€ã«ã眮ãæããå®éã®ãã·ã³ã§æ§æãçæããã¹ã¯ãªãããèšè¿°ããŠãDHCPãä»ããŠäœ¿çšå¯èœãªãã¹ãŠã®ã€ã³ã¿ãŒãã§ã€ã¹ãæ§æããå¿
èŠããããŸããã
ããããžã§ãã³ã°ã¯Ansibleã䜿çšããŠè¡ãããŸãã ããã¯ãããããçš®é¡ã®ãœãããŠã§ã¢ãšãââãŒããŠã§ã¢ãæ§æããããã®éåžžã«äŸ¿å©ãªããŒã«ã§ãã ããããAnsibleãš2çªç®ã®pythonãæçµã€ã¡ãŒãžã®å¿ èŠãªã©ã€ãã©ãªãŒãã€ãŸã圹ã«ç«ããªããã©ã¹ãã«å«ããããããŸããã ä»®æ³ç°å¢ããã°ãèµ·ãããŠãããã·ã³ã«Ansibleãé 眮ããæ°ã¯ãããŸãããäœæ¥ãè€éã«ãªããŸãã
Vagrantã䜿çšãããšãåããã¬ã€ããã¯å ã§Ansibleã1å°ã®ãã·ã³ïŒPXEãã¹ããµãŒããŒïŒã«é 眮ããããããä»ã®ãã·ã³ãå±éã§ããŸãã ãã®ããã«ã¯ããã·ã³ãéçã€ã³ãã³ããªã«ç»é²ããŠããããæå¹ãªã€ã³ãã³ããªã«ç»é²ããå¿ èŠããããŸãã ããŠãæåŸã®æ®µèœã®ã€ã³ã¿ãŒãã§ãŒã¹ã®æ§æã«é¢ããåé¡ã解決ããŸããã
ãããããºãããŒã
Squashfsã¯èªã¿åãå°çšã®å§çž®ãã¡ã€ã«ã·ã¹ãã ã§ãã ã»ãšãã©ã®æ¢åã®Linux LiveCDã®åºç€ãšãªããŸãã ããã«ãããã·ã³ã¯ã©ã€ã¢ã³ãã®RAMã«åãŸãã·ã¹ãã ã®ããªãã³ã³ãã¯ããªã€ã¡ãŒãžãäœæã§ããŸãã
/tmp
ã /run
ã /proc
ã /sys
ã /usr/share/doc
ãªã©ãæçµã€ã¡ãŒãžããå€ãã®ãã®ãåãåºãå¿
èŠããããŸãã
mksquashfs
ãŠãŒãã£ãªãã£ã¯ããã¡ã€ã«ãé€å€ããããã«ããã«ãã¹ããã¹ã¯ãæ£èŠè¡šçŸã®3çš®é¡ã®ãªã¹ãããµããŒãããŠããŸãã ãã¹ãŠãããŸãããããã«æããŸãã ãã ããæåŸã®2ã€ã®ãªãã·ã§ã³ã¯/
å§ãŸããã¹ããµããŒãããŠããŸããã æåŸã®ãã©ã«ããŒãé€å€ããã«ãäžéšã®ãã©ã«ããŒæ§é å
ã®ãã¹ãŠã®ãã¡ã€ã«ãé€å€ã§ããŸããã§ããã
ç§ã¯ããã«ãããšæŠãããšã«ããããããé€å€ããå¿
èŠããããã¹ãŠã®ãã¡ã€ã«ãšãã©ã«ããŒãfind
ãŠããã«ãã¹ã«æ²¿ã£ãŠäŸå€ãä»ããŠ1ã€ã®å€§ããªãã¡ã€ã«ã«è©°ããŸããã Crutches.jpgã ããããããã¯æ©èœããŸãã æçµã€ã¡ãŒãžã§ã®ãã®ã¢ãããŒãã®å¯äžã®ææç©ã¯ãããã»ã¹çªå·mksquashfsã«å¯Ÿå¿ããå¯äžã®ãã©ã«ããŒ/proc/NNN
ã§ãããäŸå€ãªã¹ãã®äœææã«ã¯ããã«ãããŸããã§ããã äžèšãããprocfsã¯ãŸã ããŠã³ããããŠããŸãã
ããžãã¯initrd
ã«ãŒãFSãããŠã³ãããããã«å¿ èŠãªãã¹ãŠã®ãã©ã€ããŒãšããžãã¯ãã«ãŒãã«ã«åŒã蟌ãŸãªãããã«ãLinuxã¯åæRAMãã£ã¹ã¯ã䜿çšããŸãã 以åã¯ããã®ãã£ã¹ã¯ããã¡ã€ã«ã·ã¹ãã ã®å®éã®ã€ã¡ãŒãžã§ããinitrd圢åŒã䜿çšãããŠããŸããã æ°ãããã©ãŒããããã«ãŒãã«2.6ã«ç»å ŽããŸãã-initramfsã¯ãtmpfsã«æœåºãããcpioã¢ãŒã«ã€ãã§ãã initrdãšinitramfsã®äž¡æ¹ãå§çž®ããŠãããŒãæéãç¯çŽã§ããŸãã å€ãã®ãŠãŒãã£ãªãã£åãšãã¡ã€ã«åã«ã¯initrdãèšèŒãããŠããŸããã䜿çšãããªããªããŸããã
Debian / Ubuntuã¯initramfs-toolsããã±ãŒãžã䜿çšããŠinitramfsãäœæããŸãã ã«ã¹ã¿ãã€ãºã®ããã«æ¬¡ã®ãªãã·ã§ã³ãæäŸããŸãã
- ããã¯-ã«ãŒãã«ã¢ãžã¥ãŒã«ãšå®è¡å¯èœãã¡ã€ã«ãå¿ èŠãªãã¹ãŠã®ã©ã€ãã©ãªãšãšãã«ã€ã¡ãŒãžã«è¿œå ã§ããç¹å¥ãªåœ¢åŒã®ã¹ã¯ãªãã
- ãã£ã¬ã¯ããª
init-bottom
ãinit-premount
ãinit-top
ãlocal-block
ãlocal-bottom
ãlocal-premount
ãlocal-top
local-premount
ã¯ã察å¿ããããŒãæã«å®è¡ãããŸãã man initramfs-toolsïŒ8ïŒãåç §ããŠãã ãã - æãèå³æ·±ãã®ã¯ãã«ãŒãFSã®ããŠã³ããæ
åœããç¬èªã®ããŒãã¹ã¯ãªãããè¿œå ããããšã§ãã main
/init
ã¹ã¯ãªããã§äœ¿çšãããã·ã§ã«é¢æ°mountroot()
å®çŸ©ããå¿ èŠããããŸãã æ§é ã«ã¯ãããŒã«ã«ãã£ã¹ã¯ã«ã«ãŒããããŠã³ãããããã®ããŒã«ã«ãšããããã¯ãŒã¯çµç±ã§ã«ãŒããããŠã³ãããããã®nfs
ãæ¢ã«ãããŸãã 䜿çšãããã¹ã¯ãªããã¯ãããŒãboot
ãªãã·ã§ã³ã«ãã£ãŠéžæãããŸãã
åèšã§ãéåžžã«ããªãããŒãªæ¹æ³ã§ã«ãŒãFSãããŠã³ãããã«ã¯ãããŒãã¹ã¯ãªãããäœæãããã®äžã«mountroot()
é¢æ°ãå®çŸ©ããããŒãboot
ãã©ã¡ãŒã¿ãŒã§ãã®ã¹ã¯ãªããã®ååãæž¡ããinitramfsã§ã¹ã¯ãªããã«å¿
èŠãªãã¹ãŠã®ããã°ã©ã ãšã¢ãžã¥ãŒã«ããã«ããããã¯ãå¿ããã«èšè¿°ããå¿
èŠããããŸãã«ãŒãã«ã
ãªãŒããŒã¬ã€ãã¡ã€ã
OverlayFS㯠ãè€æ°ã®ã«ãŒããã¡ã€ã«ã·ã¹ãã ãäœæããããã«äœ¿çšãããŸãã æåã®ããŒãžã§ã³ã§ã¯ãAUFSã䜿çšãããŠããŸããïŒã»ãšãã©ã®Linux LiveCDã§äœ¿çšãããŠããŸãïŒã ããããã«ãŒãã«ã«ã¯åãå ¥ããããªãã£ããããOverlayFSã«åãæ¿ããããšããå§ãããŸãã
å®éã®ã«ãŒãFSãinitramfså
ã®ãã£ã¬ã¯ããªã«ããŠã³ãããåŸã klibc-utils
run_init
ããã°ã©ã ãèµ·åããŸãã ã«ãŒãFSãinitramfså
ã«ããŠã³ããããŠããããšã確èªããinitramfsãã¯ãªãŒã³ã¢ãããïŒã¡ã¢ãªã倱ãå¿
èŠãããã®ã¯ãªãã§ããïŒïŒãã«ãŒãFSã®ããŠã³ããã€ã³ãã/
ã«ç§»åããã·ã¹ãã initãå®è¡ããŸãã 詳现 å€éšãŠãŒãã£ãªãã£ã䜿çšããã¹ã¯ãªããã¯ãinitramfsãã¯ãªã¢ãããšå£ããã®ã§ããã®ããã°ã©ã ã¯åå¥ã®å®è¡å¯èœãã¡ã€ã«ãšããŠã³ã³ãã€ã«ãããŸãã
ã«ãŒãFSãinitramfså
ã«ããŠã³ããããè€æ°ã®ãªãŒããŒã¬ã€ããã¢ã»ã³ãã«ãããŠããå Žåã run_init
ãããã®ããŠã³ããã€ã³ããæ¶ããŠå£ããŸãã ãã®åé¡ã¯ããªãŒããŒã¬ã€ã®ããŠã³ããã€ã³ããã«ãŒãFS å
ã§ç§»åããããšã§è§£æ±ºã§ããŸãã ååž°:)次ã®ããã«mount --move olddir newdir
ãŸãïŒ mount --move olddir newdir
ã
AppArmorã¯ç¡å¹ã«ããå¿
èŠããããŸããããã®ãããã¡ã€ã«ã¯ãåäžã®ããã€ã¹ããã«ãŒãFSãçŽæ¥ããŠã³ãããããã«èšèšãããŠããŸãã OverlayFSã䜿çšãããšãã圌女ã¯/sbin/dhclient
ãå®éã«/AUFS/root/sbin/dhclient
ã§ããããããã¡ã€ã«ãå£ããŠããããšã確èªããŸãã ããã䜿çšããå¯äžã®ãªãã·ã§ã³ã¯ããã¹ãŠã®ã¢ããªã±ãŒã·ã§ã³ã®ãã¹ãŠã®ãããã¡ã€ã«ãæžãæããå¿
èŠã«å¿ããŠæŽæ°ããããšã§ãã
ã©ãã§é²é³ãå¿ èŠã§ãã
ãã®èãã§ã¯ããã¹ãŠã®FSãèªã¿åãå°çšã§ããŠã³ããããŠããå ŽåãLinuxã¯éãã«åäœã§ããŸãã ããããå€ãã®ããã°ã©ã ã¯ãã£ã¹ã¯ãžã®æžã蟌ã¿æ©èœã«äŸåããŠãããããããã«tmpfsãããŠã³ãããå¿ èŠããããŸãã
-
/tmp
ã/var/tmp
ãã¡ãããéåžžã«å€ãã®å¿ èŠæ§ -
/var/log
æžã蟌ã -
/run
-ã»ãšãã©ã®ãµãŒãã¹ã¯ãããªãã§ã¯éå§ãããŸãã -
/media
media-æ¥ç¶ãããã¡ãã£ã¢ãããŠã³ãããŸã -
/var/lib/system
-systemdã®å€ãã®ããã°ã©ã ãç¹ã«systemd-timesyncd
ã§äœ¿çšããsystemd-timesyncd
-
/var/lib/dhclient
ããã§dhclientã¯ãªãŒã¹ã«é¢ããæ å ±ãæžã蟌ã¿ãŸã -
/etc/apparmor.d/cache
ãŸã AppArmorã«åã£ãŠããå Žåã¯ã/etc
ãã¡ã€ã«ãæžã蟌ãå¿ èŠããããŸã/etc
ç§èŠå«ãªããã®ãããªããšã®ããã«/var
ãŸãã
åèš
ãããã¯ãŒã¯çµç±ã§ããŠã³ããŒãå¯èœã§ãã¡ã¢ãªããã®ã¿åäœããUbuntuãã«ãããã«ãããå Žåã¯ãæ¢è£œã®äŸ¿å©ãªã³ã³ã¹ãã©ã¯ã¿ãŒthinclientããããŸãã å©ããå¿ èŠãªå Žåã¯ãPMãŸãã¯GitHubã®ãã±ããã«æçŽãæžããŠãã ããã
PS ç§ã®ããã°ã®èšäº ã® è±èªç ã