Hot code loading
From Openmoko
(→Load the code) |
(→Start erlang as a node) |
||
Line 7: | Line 7: | ||
#!/bin/sh -e | #!/bin/sh -e | ||
#zhone > /tmp/zhone.log 2>&1 & | #zhone > /tmp/zhone.log 2>&1 & | ||
− | /home/root/cean/start.sh -setcookie SFEWRG34AFDSGAFG35235 - | + | /home/root/cean/start.sh -setcookie SFEWRG34AFDSGAFG35235 -name neo@192.168.0.202 -noshell -pa /home/root/trunk -s main start > debug.txt |
renice -3 $! | renice -3 $! | ||
exit 0 | exit 0 | ||
Line 15: | Line 15: | ||
Every erlang node in your network should have a unique name, and a common cookie. | Every erlang node in your network should have a unique name, and a common cookie. | ||
+ | |||
+ | From your host erlang console try | ||
+ | <pre | ||
+ | net_adm:ping('neo@192.168.0.202'). | ||
+ | </pre> | ||
+ | The response should be 'pong' if you have a successful connection - if not the response is 'pang' | ||
=== Load the code === | === Load the code === | ||
To carry out Hot Code Loading you start a an erlang node on your host (remember to set a different name and to use the same cookie) and from the host erlang shell type nl(your_modulename). Substitute your_modulename with the name of the module you want to load into the virtual machine. | To carry out Hot Code Loading you start a an erlang node on your host (remember to set a different name and to use the same cookie) and from the host erlang shell type nl(your_modulename). Substitute your_modulename with the name of the module you want to load into the virtual machine. |
Revision as of 20:24, 5 December 2008
To change a running system
Start erlang as a node
This is my /etc/X11/Xsession.d/80zhone. As you can see the erlang node's got a name "-sname moko" (a running erlang virtual machine is called an erlang node). And it's got a cookie "-setcookie SFEWRG34AFDSGAFG35235".
#!/bin/sh -e #zhone > /tmp/zhone.log 2>&1 & /home/root/cean/start.sh -setcookie SFEWRG34AFDSGAFG35235 -name neo@192.168.0.202 -noshell -pa /home/root/trunk -s main start > debug.txt renice -3 $! exit 0
Every erlang node in your network should have a unique name, and a common cookie.
From your host erlang console try
The response should be 'pong' if you have a successful connection - if not the response is 'pang' === Load the code === To carry out Hot Code Loading you start a an erlang node on your host (remember to set a different name and to use the same cookie) and from the host erlang shell type nl(your_modulename). Substitute your_modulename with the name of the module you want to load into the virtual machine.