Geek Lair

Ubuntu Lucid: Disable services from starting up during boot time

with one comment

I use MySql only occasionally on my Ubuntu Lucid Lynx (10.04) install. As such, I didn’t want the mysql server starting up automatically during boot process. There must be a better way of disabling a service, but this is what worked for me:

Ubuntu now uses Upstart to startup services during boot time. The config files for the services are in /etc/init and they all have filenames ending in .conf.

The config files have a “start on” section which will have events on which the service should start. Commenting out that section prevents the service from starting automatically.

If you want to disable a service, say mysql, edit its config file – /etc/init/mysql.conf.

Change this:

start on (net-device-up
    and local-filesystems
    and runlevel [2345])
stop on runlevel [016]

to this:

#start on (net-device-up
#    and local-filesystems
#    and runlevel [2345])
stop on runlevel [016]

Reboot.

To see the status of the Upstart jobs run this command:

initctl list

The output should look something like this:

alsa-mixer-save stop/waiting
avahi-daemon start/running, process 1061
mountall-net stop/waiting
nmbd stop/waiting
rc stop/waiting
rsyslog start/running, process 1046
.
.
mysql stop/waiting
.
.

Since the “start on” section was commented out in /etc/init/mysql.conf, the mysql job status will show up as “stop/waiting”

To start the mysql server manually, use the start command:

sudo start mysql

Now if you run the command initctl list, the mysql job will be in running status:

alsa-mixer-save stop/waiting
avahi-daemon start/running, process 1061
mountall-net stop/waiting
nmbd stop/waiting
rc stop/waiting
rsyslog start/running, process 1046
.
.
mysql start/running, process 9462
.
.

To stop the mysql server, use the stop command:

sudo stop mysql

About these ads

Written by anonir

August 9, 2010 at 23:28

Posted in Linux, Ubuntu

Tagged with , , ,

One Response

Subscribe to comments with RSS.

  1. [...] https://anonir.wordpress.com/2010/08/09/ubuntu-lucid-disable-services-from-starting-during-boot/ Like this:LikeBe the first to like this post. Categories: linux, tip/trick ความเห็น (0) ติดตาม (0) ใส่ความเห็น Trackback [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: