[ubuntu-us-mi] run apache and mysql as services at startup

Julia Christianson julia at nscjc.net
Mon Sep 19 11:42:41 UTC 2011


Eric,

I haven't done much with services in Ubuntu, only Red Hat/Centos, so not 
an expert here, but I did notice that you said

   sudo update-rc.d apache2 default

but the syntax actually is

   sudo update-rc.d apache2 defaults

('s' on the end of 'defaults').  So I'd suggest you put the scripts back 
like they were and try update-rc.d with 'defaults'.

What's going on here:  In order to get a service to start in a 
particular runlevel, you need a file in the appropriate /etc/rc*.d 
directory that starts with a capital S followed by a two-digit number 
and the name of the service.  This file is actually just a symlink to 
the script that starts the service, e.g. /etc/rc2.d/S38httpd -> 
/etc/init.d/httpd.

**BUT** (a) I only say rc2.d because someone just said that's the 
default runlevel for Ubuntu (I never have been clear on that), (b) I 
just made up '38'; the numbers indicate the order of execution and it 
can be important, and (c) I'm not even sure that 'httpd' is the name of 
the script in /etc/init.d/, all of which indicate it's better to get 
something like update-rc.d to make that symlink for you.

-- Julia




More information about the ubuntu-us-mi mailing list