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