[opensuse-autoinstall] Init-scripts and nfs location
Using autoyast on Sles 9 SP3. pxebooting using dhcp. Installing over NFS, Autoyast file served up via NFS, so I know that all works fine. Autoinstall all works fine. I get a fully installed ready to go system. So now I am trying to use/configure some init scripts. I have two of them. One I have placed the source in the xml, and the other via NFS. <scripts> <init-scripts config:type="list"> <script> <filename>init-zeus_bootstrap</filename> <interpreter>shell</interpreter> <location>nfs://192.168.1.1/vol/prod_LinuxInstall_grn_x/zeus/zeus_bootst rap</location> </script> <script> <filename>init-online-update.sh</filename> <interpreter>shell</interpreter> <source><![CDATA[ /usr/bin/online_update -s -u http://lx4-adm.grn.tudor.com/YOU -V > /var/tmp/online-update.out 2> /var/tmp/online-update.err ]]></source> </script> </init-scripts> </scripts> The one with source works fine. The other doesn't seem to work. So 1: Is the location paramter supported on Sles 9.3 for init scripts. 2: Is this section parsed and the files created at a time when the network is up, so that NFS is available? 3: Are there some log files that will help me. Since the script never runs, there is nothing in /var/adm/autoinstall. It looks like the script never gets copied from NFS and placed in there. Thanks -Andrew -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Tuesday 12 December 2006 21:25, Andrew Laden wrote:
The one with source works fine. The other doesn't seem to work. So 1: Is the location paramter supported on Sles 9.3 for init scripts.
yes
2: Is this section parsed and the files created at a time when the network is up, so that NFS is available?
yes, that works fine (I just tried it again to be sure) Because you are doing a network installation, it should work for you too. At the moment I can not say why it does not work for you. It works fine here. -- ciao, Uwe Gansert Uwe Gansert, Server Technologies Team SUSE LINUX Products GmbH, Maxfeldstrasse 5, D-90409 Nuernberg, Germany Business: http://www.suse.de/~ug -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Wednesday 13 December 2006 11:25, Uwe Gansert wrote:
1: Is the location paramter supported on Sles 9.3 for init scripts.
yes
sorry, a network location is not supported for init-scripts on SLES9
2: Is this section parsed and the files created at a time when the network is up, so that NFS is available?
yes, that works fine (I just tried it again to be sure)
my test was wrong. A big sorry for that but I accidently raised the network up during my test by myself. At the time where the init-script must be fetched, the network is down on SLES9. So a network <location> does not work. You can try <location>file:///...</location> for the init-script and fetch the script with a post-script (network_needed=true) I did not try that but it should work -- ciao, Uwe Gansert Uwe Gansert, Server Technologies Team SUSE LINUX Products GmbH, Maxfeldstrasse 5, D-90409 Nuernberg, Germany Business: http://www.suse.de/~ug now playing Assemblage 23 - Awake -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Uwe Gansert wrote:
On Wednesday 13 December 2006 11:25, Uwe Gansert wrote:
1: Is the location paramter supported on Sles 9.3 for init scripts.
yes
sorry, a network location is not supported for init-scripts on SLES9
2: Is this section parsed and the files created at a time when the network is up, so that NFS is available?
yes, that works fine (I just tried it again to be sure)
my test was wrong. A big sorry for that but I accidently raised the network up during my test by myself. At the time where the init-script must be fetched, the network is down on SLES9. So a network <location> does not work. You can try <location>file:///...</location> for the init-script and fetch the script with a post-script (network_needed=true) I did not try that but it should work
Like a lot of folks, I grew weary of XML changes and kind of went the other route. I have a very simplistic path through my code to generate bare bones XML, really 2, one for patterns, one for packages, and tend to do almost all of the post install heavy lifting in a perl script. It's just easier for me to maintain that way, your mileage may vary. I also give allow my users to layer in as much bash as they'd like in post, so they can tweak things like SSH keys and firewall rules based on what type server they are building. So here's how I did it: <scripts> <post-scripts config:type="list"> <script> <filename>final</filename> <interpreter>perl</interpreter> <source> <![CDATA[ #Find a nic to activate for %post install my $nic; opendir(DIR,"/etc/sysconfig/network"); foreach my $file (readdir(DIR)) { next unless ($file =~ /^ifcfg-eth/); print "Found $file -"; $file =~ s/^ifcfg-//; $nic = $file; last; } closedir(DIR); print " calling /sbin/ifup $nic!\n"; system "/sbin/ifup $nic"; open(NIC,">/tmp/nic"); print NIC "$nic\n"; close(NIC); # A whole bunch of PERL that does stuff like configure apt or yum, install 3rd party software like OpenView, # Data protector, bond production nics, setup NTP server based on location, apply patches, etc. # I own this code, system managers can't touch/see it. # At this point you could wget/execute your final script(s). ]]> </source> </script> <script> <filename>final-user</filename> <interpreter>shell</interpreter> <source> <![CDATA[ # Here's where I put in the system manager's BASH. They do things like tweak firewall rules, install # SSH keys, etc. Since APT/YUM are installed and pointed out our internal depots, they manage all this # stuff using RPMs for the most part. if [ -r "/tmp/nic" ] then NIC=`cat /tmp/nic` /sbin/ifdown $NIC fi ]]> </source> </script> </post-scripts> </scripts> Yes, most of this could be done with AutoYast, but I'd have to track every RTG/DTD change, and that got tedious for me. This also works on 9.X/OpenSuSE as well as SLES, so it's how we do it all. Does it take a little longer than doing it all in AutoYast? Maybe, but we tend to install once, run for a LONG time, so it's a don't care for me. There's more than one way to do it, I work for HP (so we're an HP shop needless to say :). I know this works on ProLiants and lots of different HP desktops/laptops. Hope that helps, Lee -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (3)
-
Andrew Laden
-
Lee Mayes
-
Uwe Gansert