◦ --pre-run-exec <program and arguments> Run the specified command before Erlang starts ◦ --run-on-exit <program and arguments> Run the specified command on exit.
:nerves, erlinit: [hostname_pattern: "nerves-%s"] のリストに設定を追加 ◦ This can be helpful when you want to alter a couple options without having to maintain a copy of the entire erlinit.config from the system. 2. Overwriting Files in the Root Filesystem ◦ rootfs_overlay で、/etc/erlinit.config をまるっと上書きする ◦ コピー元: deps/nerves_system_rpi4/rootfs_overlay/etc/erlinit.config • 注意点: 両方同時には使えない! 理由は、やれば分かるので Let’s 論よりRUN
◦ All applications are taken down smoothly, all code is unloaded, and all ports are closed before the system terminates by calling halt(Status). If command-line flag -heart was specified, the heart program is terminated before the Erlang node terminates. • exit() ◦ Exit the current IEx session • Let’s 論よりRUN
Timer (WDT) is a hardware circuit that can reset the computer system in case of a software fault. You probably knew that already. ◦ ソフトウェアの死活監視(?)検知(?)機能 • 試してみよう!! ◦ echo ‘’ > /dev/watchdog0 で起こす ▪ 起こした後は定期的(タイムアウトする前に)になでてやらないとブチギレ発生 ▪ タイムアウトは ◦ echo ‘V’ > /dev/watchdog0 で寝かす
process. heart sends periodic heartbeats to an external port program, which is also named heart. The purpose of the heart port program is to check that the Erlang runtime system it is supervising is still running. If the port program has not received any heartbeats within HEART_BEAT_TIMEOUT seconds (defaults to 60 seconds), the system can be rebooted. Erlang VM Linux heart heartbeats 生きてる?もし、死んだ ら cmd しよう! Erlang VM の死活監視の仕組み $ erl -heart #別シェルで、確認できる $ ps auxw | grep heart
specifically for Nerves-based devices. Erlang VM Linux heart heartbeats heart と watchdog による二重の死活監視 Erlang VM と heart が同時にイカれても最後はワンワンがなんとかしてくれる watchdog pets If Erlang VM stopped its heartbeats, • HEARTBEAT_TIMEOUT < WATCHDOG_TIMEOUT heart reboots the OS • HEARTBEAT_TIMEOUT > WATCHDOG_TIMEOUT watchdog reboots the OS heartbeat が 来たら pet する