LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora - Installation (https://www.linuxquestions.org/questions/fedora-installation-39/)
-   -   %post section of Fedora8 kickstart install doesn't run (https://www.linuxquestions.org/questions/fedora-installation-39/post-section-of-fedora8-kickstart-install-doesnt-run-659150/)

scott.anderson 07-29-2008 10:02 PM

%post section of Fedora8 kickstart install doesn't run
 
I've used kickstart pretty well to do most of the installation of Fedora8, but I'd like to do a few things in the %POST section, but I can't seem to get it to work. Specifically, the commands in the %POST section don't get executed. I've edited the .cfg file with system-config-kickstart, so I don't think there's a syntax problem. The relevant section of the .cfg file is:

%post --nochroot
mkdir /students
mkdir /usr/network
mount -o nolock 149.130.136.19:/usr/network /usr/network
open -s -w -- /usr/network/scripts/fedora-client.script yes
%end

Even the first command, to make the /students directory, doesn't happen. That is, when I go to the machine after kickstart completes, the directory doesn't exist. I've looked in /root/install.log and /root/install.log.syslog, and I see no errors or other notations. I've looked in /root/anaconda-ks.cfg and the same %post section is there, so it seems to have "read" the commands.

Any ideas what I'm doing wrong or how to debug this? I'd be happy to post the entire kickstart file if necessary.

Thanks,

Scott

forrestt 07-30-2008 02:58 PM

It's making the directories, it is just making them in the ramfs that the installer creates when it boots since you told it to NOT use a chrooted environment (the chrooted environment == your future system, non-chrooted environment == the installer's environment).

What you want is:

Code:

%post --nochroot
mkdir /mnt/sysimage/students
mkdir /mnt/sysimage/usr/network
mount -o nolock 149.130.136.19:/usr/network /mnt/sysimage/usr/network
open -s -w -- /mnt/sysimage/usr/network/scripts/fedora-client.script yes
%end

OR

Code:

%post
mkdir /students
mkdir /usr/network
mount -o nolock 149.130.136.19:/usr/network /usr/network
open -s -w -- /usr/network/scripts/fedora-client.script yes
%end

I'm guessing you want the second one since you probably want to have the script you are running to affect the new system and not the installer system.

HTH

Forrest

scott.anderson 07-31-2008 08:41 AM

Doh! Thank you, Forestt! I was mis-understanding what the nochroot was doing, probably because of reading a mailing list that is constantly referring to "chroot jails" and that seemed like what I didn't want. But I now see that "chroot" is exactly what I want.

I also found the following:

http://www.redhat.com/docs/manuals/e...allconfig.html

That page doesn't describe the effect of chroot well, but does give some useful examples.

Thanks again,

Scott


All times are GMT -5. The time now is 02:16 PM.