zellda's

notes on Linux

Services - Debian, Ubuntu

Handle Services in Debian Based Distros

This is an update on my old services-post.

To enable services at system-boot:

bum - graphical Boot-Up-Manager

To install it just run:

Terminal
1
sudo apt-get install bum

Start it from terminal with:

Terminal
1
gksu bum

rcconf - utility

Install:

Terminal
1
sudo apt-get install rcconf

Run:

Terminal
1
sudo rcconf

update-rc.d

It’s simply a script run in a terminal (I guess that is the original Debian-way).

Use:

In a terminal type:

Terminal - Start services at system start
1
update-rc.d service-name defaults
Terminal - Disable services to start at system boot
1
update-rc.d service-name remove

sysv-rc-conf (see below as well)

Install:

Terminal
1
sudo apt-get install sysv-rc-conf

Use:

Terminal
1
sudo sysv-rc-conf

Start / stop services on the fly:

sysv-rc-conf (see above as well)

Install:

Terminal
1
sudo apt-get install sysv-rc-conf

Use:

Terminal
1
2
3
4
sudo service service-name status
sudo service service-name restart
sudo service service-name stop
sudo service service-name start

Manually:

Terminal
1
2
3
4
sudo /etc/init.d/service-name status
sudo /etc/init.d/service-name restart
sudo /etc/init.d/service-name start
sudo /etc/init.d/service-name stop

Start services delayed

Recently the problem occured to start a daemon (dnsmasq) delayed, as it needed the dns router to work properly on a different machine.

Here’s how you do it:

Open rc.local and paste the following:

rc[.]local
1
sleep 300 /etc/init.d/SERVICE start

or:

rc[.]local
1
(sleep 300 && /etc/init.d/SERVICE start/restart)

e.g.:

rc[.]local
1
(sleep 300 && /etc/init.d/mysql restart)

Both lines seem to work.

Attention! Last time the first line in rc.local read:

rc[.]local
1
#!/bin/sh -e

It didn’t work without removing -e which prevents rc.local from being processed at all.

That’s it. Just a minor update. Done.

Have fun!

Comments