User:Meeg: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
Reboot.
Reboot.


==init.d script==
==trackclient.py==
The current init.d script (/root/cerebro/bin/cerebro.init) fails to stop Cerebro because some of the commands in /etc/rc.d/init.d/functions cannot handle the full string "cerebro -p -i msh0 &". The following is a quick fix for this problem:

<pre>
<pre>
- cer = os.popen('pidof -x cerebro').read()
diff newinit cerebro/bin/cerebro.init
- cerui = os.popen('pidof -x cerebroui.olpc').read()
31,32c31,32
< if [ -n "`pidof -x ${prog%%\ *}`" ] ; then
+ cer = os.popen('pidof -x cerebro').read().strip()
< killproc ${prog%%\ *}
+ cerui = os.popen('pidof -x cerebroui').read().strip()
---
> if [ -n "`pidfileofproc $prog`" ] ; then
> killproc $prog
</pre>
</pre>


Line 51: Line 46:


"cerebroui" will start the UI.
"cerebroui" will start the UI.
-->
==keeper.py==
==keeper.py==
self.buddy['ip'] = os.popen('ifconfig eth0|grep "inet addr"|cut -d: -f2|cut -d\ -f1').readline().strip()
self.buddy['ip'] = os.popen('ifconfig eth0|grep "inet addr"|cut -d: -f2|cut -d\ -f1').readline().strip()
-->

Revision as of 16:44, 23 July 2008

Installing Cerebro

In a terminal:

su -
yum -y remove cerebro
yum -y install git python-setuptools-devel.noarch
git clone git://dev.laptop.org/projects/cerebro
cd cerebro
./install.sh

Reboot.

trackclient.py

-            cer   = os.popen('pidof -x cerebro').read()
-            cerui = os.popen('pidof -x cerebroui.olpc').read()
+            cer   = os.popen('pidof -x cerebro').read().strip()
+            cerui = os.popen('pidof -x cerebroui').read().strip()

Notes

The Cerebro package in the latest Joyride builds (joyride-2130 or later) is largely equivalent to what you get by manually installing Cerebro from the git repository.

Version of your installed Cerebro package: "yum info cerebro"

Version in git: in your /root/cerebro folder, "git-log"

Assuming these match, the following things (needed for the study but not for Cerebro functionality) are done by /root/cerebro/install.sh but not by the Cerebro package:

  • Add ypod's ssh key to your authorized_keys
  • Set Cerebro to start at boot
  • Add trackclient.py to your rc.local

setup_cerebro.sh in my public is a script based on install.sh (cut out the actions redundant with the package and added the git stuff) that you can use to do this. Note that if you do this, cerebroui will be in your path, whereas install.sh puts it in your home directory.