Adminbuntu

Everything for the Ubuntu Server Administrator

User Tools

Site Tools


Sidebar

Server Administration


Server Applications


At the Command Line


Elsewhere


Copyright 2013 Applied Conscious Technologies, LLC

Terms of Agreement

Contact


submit to reddit

services

Server Administration

Services

Service Administration on an Ubuntu Server

see also: Daemons

What are System Services?

In addition to the kernel, a Linux system has many other programs that normally running that provide services to users and programs. These system services provide much of the functionality of a system like SSH, web servers, etc. For examples, see List of Ubuntu Services.


List Services

This simple command will show all of the services on the server and their current status.

service --status-all

List Service Port Number Assignments

The /etc/services file provides a plain text description of possible services with a terse description. This list shows the protocol for each service and standard port assignment. Many also have a short description.

less /etc/services

services man page: http://manpages.ubuntu.com/manpages/precise/man5/services.5.html

Chkconfig

The chkconfig utility seems to be a bit more informative about exactly which services are configured to run on a system.

Installation
sudo aptitude -y install chkconfig
Usage

The –list switch shows a nicely formatted and accurate list of services configured to run on the system

chkconfig --list

chkconfig man page: http://manpages.ubuntu.com/manpages/precise/man8/chkconfig.8.html

Run, Stop, Test and Restart Services

Use the service command to control services.

Service Status

service servicename status

Example, Apache

To check whether Apache is running:

service apache2 status

Output:

Apache2 is running (pid 3034).

Using Netstat to Check a Service

You can also use netstat to check a system service. For example, to check whether mysql is running:

sudo netstat -tap | grep mysql

Start a Service

sudo service servicename start

Stop a Service

sudo service servicename stop

Reload a Service

sudo service servicename reload

Restart a Service

sudo service servicename restart

service man page: http://manpages.ubuntu.com/manpages/precise/man8/service.8.html

Control Whether a Service Starts Automatically When the Server Boots

The Linux admin utility sysv-rc-conf is a full-screen utility that allows an admin to easily control server services, including whether they start automatically when the server boots.

sysv-rc-conf project page: http://sysv-rc-conf.sourceforge.net/

sysv-rc-conf man page: http://manpages.ubuntu.com/manpages/precise/man8/sysv-rc-conf.8.html

Install sysv-rc-conf

sudo aptitude install sysv-rc-conf

Run sysv-rc-conf

sudo sysv-rc-conf

List of Ubuntu Services

This a partial list of services that can run on an Ubuntu Server.

service description
acpid Advanced Configuration and Power Interface event daemon. See http://manpages.ubuntu.com/manpages/precise/man8/acpid.8.html
apache2 Apache web server. See Apache
apparmor Security enhancement. See Apparmor
apport System to collect information about crashes and other events. See https://wiki.ubuntu.com/Apport
atd Run jobs queued for later execution. Seehttp://manpages.ubuntu.com/manpages/precise/man8/atd.8.html
bootlogdv Record boot messages. See: http://manpages.ubuntu.com/manpages/precise/man8/bootlogd.8.html
cron Cron is a system daemon used to execute desired tasks (in the background) at designated times. See Cron
dbus The D-Bus message bus daemon allows programs to communicate with each other. See http://manpages.ubuntu.com/manpages/precise/man1/dbus-daemon.1.html
denyhosts Denyhosts is a security enhancement that blocks attackers after a number of breaching attempts. See DenyHosts
dmesg Dmesg prints or controls the kernel ring buffer. See http://manpages.ubuntu.com/manpages/dapper/man8/dmesg.8.html
mysql
postfix Mail server.
rsync Allows powerful and efficient copying of data. See Rsync
ssh Secure Shell. See SSH
sudo Allows a user to execute a command as another user. See Sudo
sysstat System statistics logger. See SAR
ufw Uncomplicated Firewall. See Firewall
urandom Kernel random number source device. See http://manpages.ubuntu.com/manpages/precise/man4/random.4.html
whoopsie Whoopsie is a daemon that is responsible for collecting error reports from apport and then sending that report to Canonical, if the user agrees to this in the apport confirmation dialog.

Upstart

Upstart is a replacement for the legacy System-V init system. It is an event-based replacement for the /sbin/init daemon that handles starting tasks and services at boot time, stopping them during shutdown and supervising them while the system is running. Upstart was developed for Ubuntu and is now used by other operating systems, including Chrome and Red Hat RHEL 6.

see: http://upstart.ubuntu.com/cookbook/

also: https://help.ubuntu.com/community/UpstartHowto

Upstart Scripts

Start/stop scripts are located in: /etc/init.d

Runlevel

Runlevel is the mode of operation that Ubuntu Server is running in. Normally, the server will be running in mode 2, “Multi-user with networking”.

mode description
0 Halt
1 Single-user mode
2 Multi-user with networking
3-5 Unused but configured the same as runlevel 2
6 Reboot

Show Current Runlevel

runlevel

services.txt · Last modified: 2015/05/31 21:20 (external edit)