[ec2-beta] init level 2-4 + network access

Eric Hammond ehammond at thinksome.com
Sun Mar 29 11:25:40 BST 2009


Darren:

Did you ever solve this issue?

If your scripts are being run from /etc/rc*.d/ (or symlinks there) then
they are run as root.  The order in which they are run relative to
network setup depends partly on the names of the files or symlinks in
that directory and partly on how fast DHCP resolves.

In the Ubuntu images I publish on http://alestic.com I found they booted
so fast that I needed to put in some checks to wait for the network to
come up (DHCP).  I did this using a command like the following (only
works on EC2):

  perl -MIO::Socket::INET -e '
   until(new IO::Socket::INET("169.254.169.254:80")){sleep 1}'

I have a suggested ticket open in launchpad for the official images:

  https://bugs.launchpad.net/ubuntu-on-ec2/+bug/308530

Each process requiring network will need to implement its own check.

--
Eric Hammond
ehammond at thinksome.com



Darren Govoni wrote:
> Hi,
>   In beta 1 I had some init scripts I wrote that pulled updates from a
> subversion server outside of EC2. In beta2 those scripts don't quite
> work entirely. After adding some logging, they seem to get hung or bail
> out on svn calls that attempt network access. That is, they run up to
> that point.
> 
> So my question is, is there any network constraints at init 2 that would
> prevent my script from working?
> 
> I will dare to also ask if they run as root like before, which I think
> my scripts require at boot time.
> 
> Warm regards,
> Darren
> 
> 




More information about the Ec2-beta mailing list