Hardware Reference
In-Depth Information
Be sure to get the indentation just the way it's shown in
Example 6-11 . You can use the tab button or spaces as long as
the number of spaces for each level of indentation is consis-
tent. That is to say, indenting by one level is two spaces, in-
denting by two levels is four spaces, and so on.
If you look at your terminal connection Galileo, you'll probably see something
like this for each time you refresh your browser:
192.168.2.1 - - [01/Jan/2001 04:39:50] "GET / HTTP/1.1" 200 -
192.168.2.1 - - [01/Jan/2001 04:39:51] "GET /favicon.ico HTTP/1.1" 200 -
The first line is showing your browser's request for the HTML page. The sec-
ond request also comes from your browser. It's looking for a graphic file called
favicon.ico . It's a file that many web sites serve so that its icon will appear
in the address bar or in your bookmarks.
Type Control-C to terminate the server.
Starting on Boot
You can make Galileo execute that Python script every time it boots.
1. From the command line, change to the directory /etc/init.d :
# cd /etc/init.d
2. Use vi to create a new file called start-server.sh . This will be a shell
script , which is just a series of commands saved in a file.
# vi start-server.sh
3. Type i to enter insert mode and add the following line, which will execute
the server script with Python and supress any output:
python /home/root/server.py >> /dev/null 2>&1 &
4. Press escape, then :x , then Enter to save the file and exit vi.
5. From the command line, make the script executable:
# chmod +x start-server.sh
6. Then add that script as a system service:
# update-rc.d start-server.sh defaults
7. Now shut down the board:
 
Search WWH ::




Custom Search