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 DaemonAnacron
- Executed delayed cron tasks at boot timeApmd
- Advanced Power Management DaemonAtd
- Runs jobs queued using the at toolAutofs
- Supports the automounter daemon allowing mount and unmount of devices on demandCrond
- The task scheduler daemonCupsd
- CUPS printer daemonDhcpd
- Dynamic Host Configuration Protocol and Internet Bootstrap Protocol ServerFtpd
- FTP Server DaemonGated
- routing daemon that handles multiple routing protocols and replaces routed and egpupHttpd
- Web Server Daemoninetd
- Internet Superserver DaemonImapd
- An imap server daemonLpd
- Line Printer DaemonMemcached
- In-memory distributed object caching daemonMountd
- mount daemonMysql
- Database server daemonNamed
- A DNS server daemonNfsd
- Network File Sharing DaemonNfslock
- Used to start and stop nfs file locking servicesNmbd
- Network Message Block DaemonNtpd
- Network Time Protocol service daemonPostfix
- A mail transport agent used as a replacement for sendmailPostgresql
- Database server daemonRouted
- Manages routing tablesRpcbind
- Remote Procedure Call Bind DaemonSendmail
- A mail transfer agent DaemonSmbd
- Samba (an SMB Server) DaemonSmtpd
- Simple Mail Transfer Protocol DaemonSnmpd
- Simple Network Management Protocol DaemonSquid
- A web page caching proxy server daemonSshd
- Secure Shell Server DaemonSyncd
- Keeps the file systems synchronized with system memorySyslogd
- System logging daemonTcpd
- Service wrapper restricts access to inetd based services through hosts.allow and hosts.denyTelnetd
- Telnet Server daemonVsftpd
- Very Secure FTP DaemonWebmin
- Web based administration server daemonXinetd
- Enhanced Internet Superserver DaemonXntd
- 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.