Advanced Kickstart applications

Source: Internet
Author: User

 

This is what I wrote when I read the document. It is basically part of the Oreilly document translated.

 

Original article: http://www.linuxdevcenter.com/pub/a/linux/2004/11/04/advanced_kickstart.html

 

Pre-And Postinstall scripts

 

Kickstart provides some basic system adjustments and settings, such as setting the root password and time zone. However, it cannot make more detailed adjustments, such as disabling certain services through chkconfig and creating specific directories. Therefore, we need to use the pre-And postinstall scripts to complete these tasks. Obviously, we can see from the name that the execution time of these two types of scripts is pre-executed before installation, and post script is executed after the entire installation process is completed. Both the preinstall and postinstall scripts are defined at the end of the ks file.

 

The preinstall script starts with % pre. The script uses a syntax similar to that in the RPM spec file. At this stage, the preinstall script can only perform some basic operations, such as searching for some files or mounting NFS sharing.

 

Postintall scripts have more potential. The postinstall script starts with % post. After the OS installation is complete, the postinstall script is executed on the newly installed system by default. The newly installed system is in the chroot environment, and the root directory is in/mnt/sysimage.

 

You can use % post-nochroot to execute some commands in non-chroot environments. For example, in the chroot environment, you cannot access the installation disc in the optical drive, because the disc is mounted to/tmp/cdrom and is in the non-chroot environment.

 

Generally, the postinstall script starts #! The custom shell such as/bin/sh is used as the first line, and then the following is a normal shell script. In this way, you can do everything you want.

 

From polygun2000 blog

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.