Hi all
I'm busy with a kickstart file to automate server installations, and I need to run a bash script right after the server has been installed for the first time. But the script only needs to run once, and it needs to run automatically. How do I do that?
Hi,
you can use the %post part of the kickstart for that, then your script will run after installation is complete but before the reboot. If you need to run it after the first reboot, I'd put it in /etc/rc.d/rc.local and let it remove itself after running succesfully. And of course copy the script to the server using the %post part of kickstart ;)
Regards,
Michel
On Sat, 2008-03-29 at 09:11 +0200, Rudi Ahlers wrote:
Hi all
I'm busy with a kickstart file to automate server installations, and I need to run a bash script right after the server has been installed for the first time. But the script only needs to run once, and it needs to run automatically. How do I do that?
Michel van Deventer wrote:
Hi,
you can use the %post part of the kickstart for that, then your script will run after installation is complete but before the reboot. If you need to run it after the first reboot, I'd put it in /etc/rc.d/rc.local and let it remove itself after running succesfully. And of course copy the script to the server using the %post part of kickstart ;)
i was going to suggest building an RPM which installs a script in /etc/init.d and enables it in rc1.d-rc3.d, this script checks to see if its run before, and if not, it runs, does its thing, then sets some kind of marker saying "been there, done that", and disables itself with `chkconfig servicename off`
this way the script could be run early in the init sequence (by using a low S?? in the symlink) or late, as you so need.
Michel van Deventer wrote:
Hi,
you can use the %post part of the kickstart for that, then your script will run after installation is complete but before the reboot. If you need to run it after the first reboot, I'd put it in /etc/rc.d/rc.local and let it remove itself after running succesfully. And of course copy the script to the server using the %post part of kickstart ;)
Regards,
Michel
On Sat, 2008-03-29 at 09:11 +0200, Rudi Ahlers wrote:
Hi all
I'm busy with a kickstart file to automate server installations, and I need to run a bash script right after the server has been installed for the first time. But the script only needs to run once, and it needs to run automatically. How do I do that?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
ok, that's what I'm looking for. I should only run after reboot. Basically I want to install the Xen3.2 rpm's on CentOS5.1 x64 after it's been installed via a kickstart file. The CentOS Xen kernel first needs to boot (thus a reboot after the installation), then install the new Xen3.2 rpm's, and reboot again. I'm sure this could then be done with a simple if statement to check if a certain file exists, say /firstboot; then execute it, if not just continues?
/etc/rc.local is a file, is there any folders where I can add it to instead, from where I can the just self-delete it? is it safe to add it as say /etc/rc3.d/S99firstboot?