Linux Learning-Service Management

Source: Internet
Author: User

1, you can manually execute the service program to operate the service

2, manually installed through the RPM or yum application, usually in the/etc/init.d/directory to create a corresponding startup script, through the service to manage

For example:

[[Email protected] ~]$ service NTPD start

[[Email protected] ~]$ service NTPD status

NTPD is stopped

[[Email protected] ~]$ service NTPD stop

[[Email protected] ~]$ service NTPD status

NTPD is stopped

After modifying the configuration of the service, you will need to restart the service, or you can use the reload parameter to reload the configuration file, if the modified profile does not know if the settings are correct, fearing that the service will fail to start after restarting, you can use Condrestart to test the new configuration file correctly. No problem to restart

Service NTPD Restart/reload/condrestart

3. Set up boot service

1, single user mode, 2, no NFS network character interface mode, 3, full-featured character interface mode, 4, undefined, 5, graphics mode, 6, restart, 0, shutdown as Init 3 switch to character interface

Use the Chkconfig command to manage the power-on startup items, but set the run level when setting the boot entry, and the default 2,3,4,5 level if you do not specify a level

Chkconfig--list #查看所有服务的运行级别信息

Chkconfig--list snmpd #查看snmpd服务所有的运行级别信息

[Email protected] ~]$ chkconfig--list snmpd

SNMPD 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[[email protected] study]# chkconfig--level 123 snmpd on #设置snmpd服务在1, 2,3 level boot

[Email protected] study]# chkconfig--list snmpd

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

[[email protected] study]# chkconfig snmpd on #默认不加级别的话, 2,3,4,5 level boot

[Email protected] study]# chkconfig--list snmpd

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


Linux Learning-service management

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.