After the operating system starts, some services and programs are started automatically. Some of these programs are not required for the server to function properly.
For the server, running redundant services and programs, which do not add points to the server, but will bring other hidden dangers:
1. Occupy Resources: One more service per run, more than a share of resources.
2. Security vulnerabilities: Every service, there may be a vulnerability or a potential vulnerability. Excess service will increase maintenance costs.
Therefore, it is very necessary to streamline the server self-starting program. For newly installed servers, you can use a script to streamline the service directly before you deploy the required services. but for a running server, it needs to be judged when it's streamlined! Otherwise, after the restart, some of the necessary service processes will not be started automatically, after restarting directly affect the business.
The following is a thin script that will shut down all the startup services before starting the following services:
Crond: Scheduled Tasks
Network: Web service, control enable NIC
Rsyslog/syslog: Operating System Log service
SSH:SSH Remote Service
Systat: Server Performance monitoring Tool
Iptables: Firewall Service
Udev-post: Dynamic Device Management
#!/bin/bash# author:cubix# date:2017-05-13# version:1.0# description:set Mini service for system boot. lang=en## Stop all services which are auto start on the system boot.for SERVICE in ' chkconfig--list |grep ' 3:on ' |awk ' {print $ "Do chkconfig $SERVICE off done # # # Set Auto Start services on system boot.for AUTOSTART in ' Chkconfig--list |grep-e ' crond|network|rsyslog|syslog|ssh|systat|iptables|udev-post ' |awk ' {print $} ' do chkconfig $AUTOSTART--le Vel 345 on done
This article comes from "Look back in a year" blog, make sure to keep this source http://cubix.blog.51cto.com/7251166/1925264
Linux thin boot start service script