你也可以加入在系统安装完毕后运行的命令。这部分内容必须在 kickstart 的最后而且用 %post
命令开头。它被用于实现某些功能,如安装其他的软件和配置其他的命名服务器。
向红帽网络 Satellite 注册:
%post
( # Note that in this example we run the entire %post section as a subshell for logging.
wget -O- http://proxy-or-sat.example.com/pub/bootstrap_script | /bin/bash
/usr/sbin/rhnreg_ks --activationkey=<activationkey>
# End the subshell and capture any output to a post-install log file.
) 1
>/root/post_install.log 2
>&1
从 NFS 共享目录运行叫 runme
的命令:
mkdir /mnt/temp
mount -o nolock 10.10.0.2:/usr/new-machines /mnt/temp open -s -w --
/mnt/temp/runme
umount /mnt/temp
Note
kickstart 模式不支持 NFS 文件锁定,因此,当挂载 NFS 目录时必须使用 -o nolock
选项。