Ubuntu system starts and stops Daemons

Source: Internet
Author: User
Keywords Ubuntu daemon
Tags apache browsers directory email error etc file information

A simpler definition for daemons is that a daemon is a program that runs unattended even if no one is logged into your system. A more common daemon has a syslog daemon that collects system error information and writes it to a log file; There are also Apache or httpd daemons used to provide Internet browsers with the pages you need to browse and the SendMail daemon to push the email received by the server to your Inbox.

Startup scripts located in the/ETC/INIT.D directory manage the active state of the daemons that are installed with the Linux package, and the start and stop commands are common to all these scripts.

Start daemon

If a startup script exists in the/ETC/INIT.D directory, its daemon will start by specifying its filename and then adding the keyword "start", as shown here:

root@u-bigboy:~#/etc/init.d/apache Start * Starting Apache 1.3 Web server ... done.root@u-bigboy:~#

Stop Daemon

The daemon can stop by specifying its filename and then adding the keyword "Stop" in the following way;

root@u-bigboy:~#/etc/init.d/apache Stop * Stopping Apache 1.3 Web server ... done.root@u-bigboy:~#

Reboot Daemon

Typically, the daemon only reads the appropriate configuration file at startup, so if you overwrite its profile, you will have to restart the daemon in order for it to take effect. A command with the keyword "Restart" will help you implement the reboot operation:

root@u-bigboy:~#/etc/init.d/apache Restart * Restarting Apache 1.3 Web server ... done.root@u-bigboy:~#

Don't worry about configuring your daemon. We'll look at some of the commonly used daemons later and take a few simple examples to learn more about them.

About service Commands

Some operating systems such as Fedora and Rathat also have quick service commands that allow you to control daemons using "Start", "Stop" and "restart", but use fewer characters. Here are some quick, intuitive examples of how to implement this feature:

[Root@bigboy ~]# service httpd start[root@bigboy ~]# service httpd stop[root@bigboy ~]# service httpd restart

The service command also has the "status" keyword, which is used to provide a concise report on the current work of the daemon.

[Root@bigboy ~]# service httpd statushttpd (PID 6135 6133 6132 6131 6130 6129 6128 6127) is 1561 ... [Root@bigboy ~]#
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.