• Home
  • Help
  • Search
  • Login
  • Register
  Show Posts
Pages: [1]
1  Linux Stuff / General Linux questions / Re: rc.local not running on: October 15, 2010, 06:37:09 PM
The linux system has a more complicated "autoexec.bat" system in place (for those who remember the dos days).
When the kernel boots, it looks for a process called init, which is the mother of all other processes.

Init uses different runlevels, which indicate different "states" of the system, which depend on the flavour of linux you are using.

runlevel 1 is commonly used for single user access
runlevel 2 on Ubuntu is the standard level (on other systems this goes to 5).
runlevel 6 is commonly reboot.

When init changes to a certain runlevel, it executes all scripts starting with S in the /etc/rc<x>.d/ directory (x stands for the runlevel).
These scripts are executed in alphabethical order, so S00 is executed before S01, etc.

When init exits a certain runlevel it executes all scripts starting with  K in the /etc/rc<x>.d/ directory.

Your rc.local script is linux distribution (Ubuntu) specific, and is probably called from another rc2.d/S.... script (I am not very familiar with Ubuntu). If this script fails, the rc.local script is not executed.

CONCLUSION:

If you want to execute some commands, regardless of the outcome of the other scripts, add an S00_myscript script in /etc/rc2.d and this will do the trick.
If you want it to execute say, after starting sshd, adjust the 00 to something bigger than the SXY starting sshd.

NOTE:

1/ Normally in rc<x>.d you make a symlink to the actual script which is in /etc/init.d. init calls the Sxy scripts with first parameter start and the Kxy scripts with first parameter stop
. So normally you will have an Sxy and Kxy link to the same script in /etc/init.d

2/ If want to know the current runlevel do echo $RUNLEVEL
2  Linux Stuff / General Linux questions / Re: SSH on sheevaplug running debian on usb/mmc is terrible!!!! on: October 15, 2010, 06:24:13 PM
Maybe very stupid, but do you have multiple devices with the same IP ??
3  Linux Stuff / General Linux questions / Re: Turning my Sheevaplug into a firewall/router/server on: October 15, 2010, 06:20:11 PM
1/ LAN layout:

Sheeva eth0: serves your local LAN.
Sheeva eth1: goes to your cable modem.
Sheeva eth2: goes to the DSL modem.

The static gateway of the hosts on the LAN have the sheevaplug.

2/ You write a small script monitoring the link to your cable modem, when it goes down you alter the routing table from eth0->eth1 to eth0->eth2.
You will probably get into trouble with iptables' stateful natting, which will cause your active connections to drop when the handover takes place,
but there is probably not much you can do here since the cable and DSL modem both have different internet IP addresses...
4  Linux Stuff / General Linux questions / Re: driver FTDCHIP on: October 15, 2010, 06:05:58 PM
Are you using the correct "gcc" ? Make sure it is the cross-compiler gcc you are using, because the error seems like you are mixing i386 binaries with arm binaries.
5  Linux Stuff / General Linux questions / Re: Headless X Server on: October 15, 2010, 06:04:05 PM

You have to install vncserver on the plug, which "renders"/"draws" the complete GUI in memory. Next, you use a standard VNC client from a standard linux/windows/iPhone to connect to the plug and "read out" this memory and draw it on the screen of this linux/windows/iPhone.
In this case you need to export DISPLAY=:1.0 before launching any GUI applications)


An alternative way is to use ssh -X to the plug from a linux box and start a GUI application (there are solutions for windows as well). This is however much slower. Also, in this case, it is the linux box which is running the X server, so when you shut down this box, you will lose all GUI applications, which is not the case with running vncserver on the plug.
Normally the ssh client on the plug will export the DISPLAY variable automatically). Make sure you enable X forwarding in /etc/ssh/sshd_config

I am using vncserver on the plug with WindowMaker: it looks cool and uses much less resources than a full blown gnome / kde.
6  Linux Stuff / General Linux questions / Re: Guruplug - reduce ethernet eth0 speed permanently on: October 15, 2010, 06:00:21 PM
I put the following line at the end of /etc/rc.local:

ethtool -s eth0 speed 100 duplex full autoneg on

This will only work if you log in I think. Why not simply create /etc/rc2.d/S00SetupSpeed and put the same line in there ?

7  Linux Stuff / General Linux questions / Re: Traffic shaping with one Ethernet? on: October 15, 2010, 05:56:05 PM
The basic problem you are facing is getting an idea of the load of your network. If you have a dual ethernet, you can set it up as a router (behind your VOIP) and know it easily.

If you have a single ethernet (sheevaplug), you can attach it to a network hub (not a switch!) and use tcpdump/iptraf to get an estimate of the usage of the network (easiest is to obtain the number of packets/s).

Once you have this measure, you modify the sources of your torrent client to throttle the speed in function of the packet load. I am familiar with running / adapting qbittorrent on the plug, this should not be to hard to realize.

8  Linux Stuff / General Linux questions / Re: GUI and VNC guruplug plus? anynone succeed? on: October 15, 2010, 05:48:11 PM
You can NOT run startx on the plug, as there is no display attached to it (unless you have a USB hardware with VGA output).

You have to install vncserver, which "renders"/"draws" the complete GUI in memory. Next, you use a standard VNC client from a standard linux/windows/iPhone to connect to the plug and "read out" this memory and draw it on the screen of this linux/windows/iPhone.

An alternative way is to use ssh -X to the plug from a linux box and start a GUI application (there are solutions for windows as well). This is however much slower. Also, in this case, it is the linux box which is running the X server, so when you shut down this box, you will lose all GUI applications, which is not the case with running vncserver on the plug.

I am using vncserver on the plug with WindowMaker: it looks cool and uses much less resources than a full blown gnome / kde.
9  Hardware and U-Boot firmware / Hardware / Re: How to power SheevaPlug with AA batteries? on: October 14, 2010, 06:18:16 AM
Quote
I live in North America, and we have a store here called "The Source", which sells battery enclosures for AA/AAA for electronic projects.  I do not know much about electronics and am not sure which casing to purchase and for how many batteries it should occupy.

I had the same problem (living in Canada) I went to KGE and bought a power supply for laptop 5V / 3A (about $15, DLINK I think), highly regulated. Opened up the case of the sheeva, removed the whole power supply, cut the red and black wire and connected to the new power supply (I also bought a female kinch-like plug ($5) so I can easily disconnect it from the laptop power supply).

It has been up and running for three months now, and I am very confident that the new power supply is going to last much longer.
10  Linux Stuff / Kernel / Re: Truecrypt for Marvell ARM with Crypto Support (2.6.32+) on: October 14, 2010, 04:00:10 AM
Truecrypt uses XTS block encoding, which is not supported by the hardware security engine on board of the sheevaplug. So, there is no solution. Either change to dm-crypt (which makes use of the hardware acceleration, I got 10-15 MB/s on USB HDD) or accept slow speed (5MB/s) with truecrypt.
Pages: [1]