# kickstart template for Fedora 8 and later. # (includes %end blocks) # do not use with earlier distros #platform=x86, AMD64, or Intel EM64T # System authorization information auth --useshadow --enablemd5 # System bootloader configuration bootloader --location=mbr # Partition clearing information clearpart --all --initlabel # Use text mode install text # Firewall configuration firewall --disabled # Run the Setup Agent on first boot firstboot --disable # System keyboard keyboard us # System language lang en_US # Use network installation url --url=$tree # If any cobbler repo definitions were referenced in the kickstart profile, include them here. $yum_repo_stanza # Network information $SNIPPET(‘network_config‘) # Reboot after installation reboot #Root password rootpw --iscrypted $default_password_crypted # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # System timezone timezone Asia/Shanghai # Install OS instead of upgrade install # Clear the Master Boot Record zerombr # Allow anaconda to partition the system as needed autopart %pre $SNIPPET(‘log_ks_pre‘) $SNIPPET(‘kickstart_start‘) $SNIPPET(‘pre_install_network_config‘) # Enable installation monitoring $SNIPPET(‘pre_anamon‘) %end %packages gcc gcc-c++ automake autoconf wget lynx lrzsz setuptool system-config-* nmap unix2dos dos2unix $SNIPPET(‘func_install_if_enabled‘) %end %post --nochroot $SNIPPET(‘log_ks_post_nochroot‘) %end %post $SNIPPET(‘log_ks_post‘) # Start yum configuration $yum_config_stanza # End yum configuration $SNIPPET(‘post_install_kernel_options‘) $SNIPPET(‘post_install_network_config‘) $SNIPPET(‘func_register_if_enabled‘) $SNIPPET(‘download_config_files‘) $SNIPPET(‘koan_environment‘) $SNIPPET(‘redhat_register‘) $SNIPPET(‘cobbler_register‘) # Enable post-install boot notification $SNIPPET(‘post_anamon‘) # Start final steps $SNIPPET(‘kickstart_done‘) # End final steps mkdir -p /root/software mkdir -p /root/shell mkdir -p /root/python mkdir -p /root/puppet mkdir -p /etc/yum.repos.d/repo mv /etc/yum.repos.d/CentOS-* /etc/yum.repos.d/repo cd /root/software wget http://mirrors.ustc.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm wget http://yum.puppetlabs.com/el/6.3/products/i386/puppetlabs-release-6-10.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm rpm -ivh puppetlabs-release-6-10.noarch.rpm sed -i ‘s/^#//‘ /etc/yum.repos.d/epel.repo sed -i ‘s/^m/#m/‘ /etc/yum.repos.d/epel.repo sed -i ‘s/localhost/test.cdpc.com/‘ /etc/sysconfig/network ip=`ifconfig |grep "inet addr:"|grep -v 127.0.0.1|awk ‘{print $2}‘|awk -F ‘:‘ ‘{print$2}‘` ssh-keygen -t rsa -f /root/.ssh/${ip}_id_rsa -N ‘‘ useradd mds echo "strong"|passwd --stdin mds #history ji lu time echo "#===============================" >>/etc/bashrc echo "HISTFILESIZE=4000" >>/etc/bashrc echo "HISTSIZE=4000" >>/etc/bashrc echo "HISTTIMEFORMAT=‘%F %T‘" >>/etc/bashrc echo "export HISTTIMEFORMAT" >>/etc/bashrc # Remove some unneeded services #-------------------------------------------------------------------------------- cat << EOF +--------------------------------------------------------------+ | === Welcome to Tunoff services === | +--------------------------------------------------------------+ EOF #--------------------------------------------------------------------------------- for i in `ls /etc/rc3.d/S*` do CURSRV=`echo $i|cut -c 15-` echo $CURSRV case $CURSRV in crond | irqbalance | microcode_ctl | network | random | sshd | syslog | local ) echo "Base services, Skip!" ;; *) echo "change $CURSRV to off" chkconfig --level 235 $CURSRV off service $CURSRV stop ;; esac done /etc/init.d/NetworkManager stop chkconfig NetworkManager off # file descriptors ulimit -HSn 65535 echo -ne " * soft nofile 65536 * hard nofile 65536 " >>/etc/security/limits.conf #setup sysctl true > /etc/sysctl.conf cat >> /etc/sysctl.conf << EOF net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 68719476736 kernel.shmall = 4294967296 net.ipv4.tcp_max_tw_buckets = 6000 net.ipv4.tcp_sack = 1 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.core.wmem_default = 8388608 net.core.rmem_default = 8388608 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 net.core.netdev_max_backlog = 262144 net.core.somaxconn = 262144 net.ipv4.tcp_max_orphans = 3276800 net.ipv4.tcp_max_syn_backlog = 262144 net.ipv4.tcp_timestamps = 0 net.ipv4.tcp_synack_retries = 1 net.ipv4.tcp_syn_retries = 1 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 1 net.ipv4.tcp_mem = 94500000 915000000 927000000 net.ipv4.tcp_fin_timeout = 1 net.ipv4.tcp_keepalive_time = 1200 net.ipv4.ip_local_port_range = 1024 65535 EOF /sbin/sysctl -p chmod 600 /etc/passwd chmod 600 /etc/shadow chmod 600 /etc/group chmod 600 /etc/gshadow %end
时间: 2024-10-12 13:32:54