Linux thin boot start service script

Source: Internet
Author: User

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

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.