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

When I reboot my Ubuntu 10.04 32 bit machine all the startup services are started twice.

The startup process looks like this:

Starting apache2
Starting apache2 
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 
no listening sockets available, shutting down 
Unable to open logs 
 Done 

 Done 

 * Starting MySQL database server mysqld        * Starting MySQL database[ OK ]  * Starting nsd3...        * Starting nsd3...
                                                                             [ OK ] 
 * Starting Postfix Mail Transport Agent postfix        * Starting Postfi[ OK ] Transport Agent postfix        
                                                                             [ OK ] 
 * Starting NTP server ntpd        * Starting NTP server ntpd            [ OK ] 
Starting daemon monitor: monit. 

I checked I don't have duplicate startup links, if I do an update-rc.d -f mysql remove then reboot mysql doesn't start at all, re-adding it still makes is start twice.

The only things in my logs are warnings about everything starting twice.

Has anyone seen this before or have a clue where to poke to find out whats causing it?

share|improve this question

I'd guess that your system is possibly going through two runlevels and executing the start scripts in each.

First I'd look at /etc/rc2.d, /etc/rc3.d, /etc/rc4.d - and remove all but one of the start symlinks and see if that works.

Use the "runlevel" command to see what runlevel you are currently in.

share|improve this answer
up vote 0 down vote accepted

Found the problem, I had a duplicate copy of /etc/init/rc.conf so upstart was running /etc/init.d/rc twice.

share|improve this answer

I had this problem in gentoo, for me what it turned out to be was I was using the sh shell on linux to run a flask app in the background in Debug mode, that software was causing two instances of flask to be run. A solution was to turn off debug mode which fixed my problem. Be slow to accuse the linux internals of the problem, often the problem is in our code. Simplify your code to do less complicated work and you can isolate the problem.

If you still think the guts of linux OS are to blame, check is that you don't have your start up scripts duplicated in your /etc/runlevels/boot, /etc/runlevels/default and /etc/init.d directories. You could check for files with the same names. If they exist, move out the ones from /etc/runlevels/default that are also in /etc/runlevels/boot.

share|improve this answer

Your Answer

 
discard

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.