Managing Linux Services

Linux services or daemons are used to automatically start software that provide services such as web servers, database servers, FTP, SSH, Samba. This article is about how to manage linux services and to set them to start automatically. Note that Linux distributions are based on System V which have run levels for system services (as opposed to BSD).

Note that the information provided here does vary between linux distributions. I’m using specific examples from CentOS (and therefore RedHat) linux distributions.

Manging Services

Services that will run can be found in /etc/init.d/.

For any one of these services, you can use the service to manage a service. For example, Samba is managed by the service smb. Use the command:

$ service smb status

This will tell you the status of the daemon programs associated with Samba (e.g. smbd and nmbd). To start or stop them you can issue commands like:

$ service smb start
$ service smb stop
$ service smb restart

Making Services Start Automatically

You can use chkconfig to add a service to a specified run level to make it start automatically.

Linux distributions have 6 run levels and these vary slightly between distributions. In CentOS and RedHat they are:

  • 1 – Single user mode
  • 2 – Multiuser, without NFS (The same as 3, if you do not have networking)
  • 3 – Full multiuser mode
  • 4 – unused
  • 5 – X11
  • 6 – reboot (Do NOT set initdefault to this)

A run level basically tells you what the mode the system is in. To find out what runlevel you are in:

$ runlevel

You can look at /etc/inittab to see how the system is configured to run processes at different run levels. This file maps the association between a run level (e.g. 3) and the services started in that run level which are typically stored in /etc/rc.d under the appropriate run level directory (e.g. /etc/rc.d/rc3.d/).

To make a service such as Samba smb start automatically, you need to add it to appropriate run levels (e.g. 3,4,5) using chkconfig:

$ chkconfig —level 345 smb on

You can then use chkconfig to see what run levels your service will be started at:

$ chkconfig —list smb

Which gives a result like this:

smb 0:off 1:off 2:off 3:on 4:on 5:on 6:off

January 21, 2010 | In Software | No Comments

Media Jukebox

Media Jukebox by J.River is perhaps the best music management/player out there for Microsoft Windows. First off, it has a great interface and doesn’t hog your PC like other media players *cough* Windows Media Player *cough*. It organises your music well, makes it easy to search, includes some nifty features including album cover art, visualisations, and it can even handle the more oppresive media formats (wma I’m looking at you). Its also skinable but I think it looks pretty good out of the box, and has support for some pretty nifty plug-ins.

January 21, 2010 | In Software | No Comments

Getting back a lost window

Ever had a program that appears on the task bar, but when open you can’t see it? Well this has happened to me when connecting to a computer with dual monitors. The solution is to use Windows {ALT+SPACE} to move the window to your current screen.

  1. Right-click on the task bar for the application that is misbehaving
  2. Press {ALT+SPACE}
  3. Select move from the menu and you should be able to drop a ghosted outline of the window into your current screen using your mouse
  4. You an also move the window manually using the keyboard arrow keys.
January 21, 2010 | In Software | No Comments

OpenDNS

OpenDNS is provides free domain name resolution (DNS) servers for you to use. These servers block a lot of bad content and are quite quick. The best way to get OpenDNS working is to configure your ADSL modem/router to use their nameserver IP addresses. Thes are:

  • 208.67.222.222
  • 208.67.220.220

You can also create a free account with them to further manage your network activity and content filtering. Note that OpenDNS provides a dynamic IP service so it will still work even if you go through a dynamic IP.

Another useful tool for managing DNS entries is zoneedit.

January 21, 2010 | In Software | No Comments

PeerBlock

PeerBlock is an alternative to the popular IP filter firewall, PeerGuardian (which has not been updated in some time). It uses lists to filter out unwanted IP addresses, such as those from advertising or spyware sites. It is also great for filtering out sites that are anti-p2p (file sharing). For full details, please see the FAQ.

January 21, 2010 | In Software | No Comments
Page 13 of 171234567891011121314151617