Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a configured EC2 server running Ubuntu 11.10 running a Django App on Apache2/WSGI. This server works perfectly, stops and restarts without any problems.

When I clone this instance, everything about it is exactly the same. I have not changed anything meaningful. will NOT full restart or stop. The app runs fine and the server doesn't seem to crash...until I try to restart/stop it.

Every time I try to STOP, it takes at least 30 to 45 seconds to stop with an [OK] message. I can immediate try to stop it AGAIN, and it will do the same thing. If I try to RESTART, then it eventually fails with an "Address already in use error". I then manually kill the stagnant OLD /usr/sbin/apache2 -k start process in order to restart. Then I still have 4 or 5 <defunct> processes that eat up resources for the rest of the life of the boot.

What can I do to figure out why this is happening. The process just gets hung EVERY single time. I've been bashing my head against this for days and am at a loss.


I just tried cloning the AMI to 2 more instances, one MICRO and one SMALL. This is VERY weird: The SMALL instance works perfectly. The MICRO instance has the same restarting issue. To verify this, I did the same thing again (cloned to another SMALL and another MICRO). Same thing....

share|improve this question

migrated from May 29 '12 at 12:07

This question came from our site for professional and enthusiast programmers.

I would follow the instructions here: – adosaiguas May 23 '12 at 22:35
make sure that there is not any sleep between reStart and Stop code. – Priyank Patel May 24 '12 at 9:53
Thanks for the tips, however I've had no success with either :( – Sunsu May 25 '12 at 16:06
I just set up a NEW instance with Ubuntu 12.04. It works perfectly. I then cloned the AMI and launched a new instance from it, and it does THE SAME THING. What in the world is going on? – Sunsu May 25 '12 at 19:50
defunct processes are just there for process accounting reasons, the resources get deallocated. see – Tom H May 29 '12 at 12:36

A notable difference between the various available instance types on Amazon EC2 is whether the instance type at hand has Amazon EC2 Instance Storage (also known as ephemeral storage) available at all, and whether it is attached, formatted and mounted by default in case. Specifically, the latter is only the case for m1.small and c1.medium instances, and the t1.micro instance is lacking this kind of storage entirely - see Instance Stores Available On Instance Types for the number and the sizes of the instance store volumes available with each instance type and Instance Store Device Names for more details on the mappings:

Instance store volumes have to be mounted on the devices before they can be used. On a Linux instance, depending on the instance type, some instance stores are formatted and mounted by default by Amazon build images. A Windows instance uses a built-in tool, EC2Config Service, to format and mount all the instance stores attached to the instance.

Consequently, depending on your setup, there might be OS/service configuration artifacts assuming storage to be available under /mnt, which in fact is not on a clone of this instance lacking that storage, for example:

  • A typical service lock file could exhibit related behavior in turn, i.e. not being able to create the lock file might not be considered a fatal error, thus the service starts fine, however, the restart/stop logic usually requires the lock file with the process id (PID) be present and will obviously fail without it.
share|improve this answer

Maybe try to lunch the server with the PidFile directive

And if it's working with the non standard pid-file, then look on the permissions of the default log file created.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.