Post

Linux - CentOS

[toc]


Daemons

  • also known as background processes
  • a Linux or UNIX program that runs in the background.
  • Almost all daemons have names that end with the letter “d”.
  • For example,
    • “Httpd” the daemon that handles the Apache server,
    • “Sshd” handles SSH remote access connections.
    • Linux often start daemons at boot time.
    • Shell scripts stored in “/etc/init.d” directory are used to start and stop daemons.

简单的说,系统为了某些功能必须要提供一些服务 (不论是系统本身还是网络方面),这个服务就称为 service

  • 但是 service 的提供总是需要程序的运行吧,如何执行呢?
  • 所以达成这个 service 的程序我们就称呼他为 daemon
  • 举例
    • cron / cron job: time-based job scheduler, Users set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals.
    • 达成循环型例行性工作调度服务 (service) 的程序为 crond 这个 daemon
    • Crond daemon is used to execute cron jobs in the background.
    • crond is started during system startup from the /etc/rc.d/init.d/crond file. The crond program itself is located under /usr/sbin/crond.

Typical functions of daemons

  • Open network port (such as port 80) and respond to network requests.
  • Monitor system such as hard disk health or RAID array.
  • Run scheduled tasks such as Cron.

List of service daemons for Linux and Unix-like systems

  • Amd - Auto Mount Daemon
  • Anacron - Executed delayed cron tasks at boot time
  • Apmd - Advanced Power Management Daemon
  • Atd - Runs jobs queued using the at tool
  • Autofs - Supports the automounter daemon allowing mount and unmount of devices on demand
  • Crond - The task scheduler daemon
  • Cupsd - CUPS printer daemon
  • Dhcpd - Dynamic Host Configuration Protocol and Internet Bootstrap Protocol Server
  • Ftpd - FTP Server Daemon
  • Gated - routing daemon that handles multiple routing protocols and replaces routed and egpup
  • Httpd - Web Server Daemon
  • inetd - Internet Superserver Daemon
  • Imapd - An imap server daemon
  • Lpd - Line Printer Daemon
  • Memcached - In-memory distributed object caching daemon
  • Mountd - mount daemon
  • Mysql - Database server daemon
  • Named - A DNS server daemon
  • Nfsd - Network File Sharing Daemon
  • Nfslock - Used to start and stop nfs file locking services
  • Nmbd - Network Message Block Daemon
  • Ntpd - Network Time Protocol service daemon
  • Postfix - A mail transport agent used as a replacement for sendmail
  • Postgresql - Database server daemon
  • Routed - Manages routing tables
  • Rpcbind - Remote Procedure Call Bind Daemon
  • Sendmail - A mail transfer agent Daemon
  • Smbd - Samba (an SMB Server) Daemon
  • Smtpd - Simple Mail Transfer Protocol Daemon
  • Snmpd - Simple Network Management Protocol Daemon
  • Squid - A web page caching proxy server daemon
  • Sshd - Secure Shell Server Daemon
  • Syncd - Keeps the file systems synchronized with system memory
  • Syslogd - System logging daemon
  • Tcpd - Service wrapper restricts access to inetd based services through hosts.allow and hosts.deny
  • Telnetd - Telnet Server daemon
  • Vsftpd - Very Secure FTP Daemon
  • Webmin - Web based administration server daemon
  • Xinetd - Enhanced Internet Superserver Daemon
  • Xntd - Network Time Server Daemon

start / stop / restart daemons

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# use the "Service command":
service daemon-name-here start
service daemon-name-here stop
service daemon-name-here restart

# start, stop, and restart "Httpd" daemon:
service httpd start
service httpd stop
service httpd restart

systemctl start crond.service
systemctl stop crond.service
systemctl restart crond.service

Sample outputs:

see list of all running daemons

```bash

To see the status all installed daemons, enter:

service –status-all

Sample outputs from CentOS development server:

acpid (pid 3914) is running… anacron is stopped atd (pid 4433) is running… auditd (pid 3537) is running… automount (pid 4174) is running… Avahi daemon is not running Avahi DNS daemon is not running hcid (pid 3821) is running… …

Sample outputs from my Ubuntu Linux desktop systems:

[ ? ] acpi-support [ ? ] acpid [ ? ] alsa-mixer-save [ ? ] anacron [ + ] apache2 [ + ] apparmor [ ? ] apport [ ? ] arpwatch [ ? ] atd [ ? ] aumix [ + ] bind9 [ ? ] binfmt-support [ + ] bluetooth [ - ] bootlogd [ ? ] bridge-network-interface [ - ] brltty

.

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.