[opensuse-autoinstall] postinstall script questions
Hi, I have some post installation scripts that I would like to call from my generic autoyast.xml file. This involves three related questions : 1) One file reads, # cat ntp.conf.sh <source> <![CDATA[ cp -f /etc/ntp.conf /etc/ntp.conf.original.autoyast cat > /etc/ntp.conf << EOF server 127.127.1.0 fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift/ntp.drift logfile /var/log/ntp keys /etc/ntp.keys trustedkey 1 requestkey 1 server 10.254.26.3 iburst restrict 10.254.26.2 restrict time.versatel.com EOF chmod 640 /etc/ntp.conf chown root:ntp /etc/ntp.conf ]]> </source> How would I reference this in the autoyast.xml script. 2) I would like to create separate package installation XML files that can be called by autoyast depending on what will be installed. One such file might read: # cat postinstall-squid.xml <software> <packages config:type="list"> <package>squid</package> </software> Where in the autoyast.xml would I call this and how. 3) Finally. if I add the package squid to the list of packages to be installed, then will autoyast install and add the nessecary user, or will I have to add the squid user into the postinstall-squid.xml with something like: <user> <encrypted config:type="boolean">true</encrypted> <fullname>WWW-proxy squid</fullname> <gid>65534</gid> <home>/var/cache/squid</home> <password_settings> <expire></expire> <flag></flag> <inact></inact> <max>99999</max> <min>0</min> <warn>7</warn> </password_settings> <shell>/bin/false</shell> <uid>31</uid> <user_password>*</user_password> <username>squid</username> </user> Best regards, S. -- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 [ -d . ] || echo 'Oh!' ******** IMPORTANT NOTICE ******** This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Hi,
I have some post installation scripts that I would like to call from my generic autoyast.xml file. This involves three related questions :
I let others to answer questions 1 & 2, but this is an easy one:
3) Finally. if I add the package squid to the list of packages to be installed, then will autoyast install and add the nessecary user
The answer is yes. If you install squid (with autoyast or in any other way), the RPM package already contains a scriptlet executed in the course of its installation that will create squid user. See: kmachalkova@opice:/work/SRC/all/squid> cat squid.spec | grep -B1 useradd AutoReqProv: on PreReq: /usr/sbin/useradd, %insserv_prereq, %fillup_prereq -- %pre /usr/sbin/useradd -r -o -g nogroup -u 31 -s /bin/false -c "WWW-proxy squid" -d /var/cache/squid squid 2> /dev/null || : So - no need to create squid user additionaly in the autoyast profile hB. -- \\\\\ Katarina Machalkova \\\\\\\__o YaST developer __\\\\\\\'/_ & hedgehog painter -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Marvellous news about the squid user. Thank-you Katarina. Katarina Machalkova wrote:
Hi,
I have some post installation scripts that I would like to call from my generic autoyast.xml file. This involves three related questions :
I let others to answer questions 1 & 2, but this is an easy one:
3) Finally. if I add the package squid to the list of packages to be installed, then will autoyast install and add the nessecary user
The answer is yes. If you install squid (with autoyast or in any other way), the RPM package already contains a scriptlet executed in the course of its installation that will create squid user. See:
kmachalkova@opice:/work/SRC/all/squid> cat squid.spec | grep -B1 useradd
AutoReqProv: on PreReq: /usr/sbin/useradd, %insserv_prereq, %fillup_prereq -- %pre /usr/sbin/useradd -r -o -g nogroup -u 31 -s /bin/false -c "WWW-proxy squid" -d /var/cache/squid squid 2> /dev/null || :
So - no need to create squid user additionaly in the autoyast profile
hB.
-- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 [ -d . ] || echo 'Oh!' ******** IMPORTANT NOTICE ******** This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Wednesday 07 October 2009 Simon Loewenthal/NL/Tele2 wrote:
I have some post installation scripts that I would like to call from my generic autoyast.xml file. This involves three related questions :
1) One file reads, # cat ntp.conf.sh <source> <![CDATA[ cp -f /etc/ntp.conf /etc/ntp.conf.original.autoyast cat > /etc/ntp.conf << EOF server 127.127.1.0 fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift/ntp.drift logfile /var/log/ntp keys /etc/ntp.keys trustedkey 1 requestkey 1 server 10.254.26.3 iburst restrict 10.254.26.2 restrict time.versatel.com EOF chmod 640 /etc/ntp.conf chown root:ntp /etc/ntp.conf ]]> </source>
How would I reference this in the autoyast.xml script.
multiple options here. You can use a post-script to do exactly what you have pasted above: http://www.suse.de/~ug/autoyast_doc/createprofile.scripts.html you can use the <files> section to let autoyast copy that content to the right place: http://www.suse.de/~ug/autoyast_doc/createprofile.completeconf.html you can use the autoyast UI to configure the NTP like you want and let autoyast do the configuration freedom of choice :)
2) I would like to create separate package installation XML files that can be called by autoyast depending on what will be installed. One such file might read: # cat postinstall-squid.xml <software> <packages config:type="list"> <package>squid</package> </software>
Where in the autoyast.xml would I call this and how.
you should use rules for that: http://www.suse.de/~ug/autoyast_doc/rulesandclass.html rules can put multiple XML snippets together to one complete file, depending on things you can only know during installation time. -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) 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
Hi Uwe, I noticed that the <location> is listed as HTTP. Is there a way to use NFS instead? <location>http://10.10.0.1/myScript.sh</location> Should I place this at the end of the autoyast.xml, but afore the </profile> tag? e.g. <postpartitioning-scripts config:type="list"> <script> <location>http://10.10.0.1/myScript.sh</location> </script> </postpartitioning-sripts> </profile> Uwe Gansert wrote:
on Wednesday 07 October 2009 Simon Loewenthal/NL/Tele2 wrote:
I have some post installation scripts that I would like to call from my generic autoyast.xml file. This involves three related questions :
1) One file reads, # cat ntp.conf.sh <source> <![CDATA[ cp -f /etc/ntp.conf /etc/ntp.conf.original.autoyast cat > /etc/ntp.conf << EOF server 127.127.1.0 fudge 127.127.1.0 stratum 10 driftfile /var/lib/ntp/drift/ntp.drift logfile /var/log/ntp keys /etc/ntp.keys trustedkey 1 requestkey 1 server 10.254.26.3 iburst restrict 10.254.26.2 restrict time.versatel.com EOF chmod 640 /etc/ntp.conf chown root:ntp /etc/ntp.conf ]]> </source>
How would I reference this in the autoyast.xml script.
multiple options here. You can use a post-script to do exactly what you have pasted above: http://www.suse.de/~ug/autoyast_doc/createprofile.scripts.html
you can use the <files> section to let autoyast copy that content to the right place: http://www.suse.de/~ug/autoyast_doc/createprofile.completeconf.html
you can use the autoyast UI to configure the NTP like you want and let autoyast do the configuration
freedom of choice :)
2) I would like to create separate package installation XML files that can be called by autoyast depending on what will be installed. One such file might read: # cat postinstall-squid.xml <software> <packages config:type="list"> <package>squid</package> </software>
Where in the autoyast.xml would I call this and how.
you should use rules for that: http://www.suse.de/~ug/autoyast_doc/rulesandclass.html
rules can put multiple XML snippets together to one complete file, depending on things you can only know during installation time.
-- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 [ -d . ] || echo 'Oh!' ******** IMPORTANT NOTICE ******** This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Wednesday 07 October 2009 Simon Loewenthal/NL/Tele2 wrote:
I noticed that the <location> is listed as HTTP. Is there a way to use NFS instead?
yes. Everything that works for autoyast=... works as <location> too.
<location>http://10.10.0.1/myScript.sh</location>
Should I place this at the end of the autoyast.xml, but afore the </profile> tag? e.g.
yes
<postpartitioning-scripts config:type="list"> <script> <location>http://10.10.0.1/myScript.sh</location> </script> </postpartitioning-sripts>
it must be between <scripts> tags too Please read the documentation and the examples for scripts.
</profile>
but don't use <postpartitioning> for the ntp.conf use a post-script -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug listening to: "Golgotha" by :Wumpscut: -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (3)
-
Katarina Machalkova
-
Simon Loewenthal/NL/Tele2
-
Uwe Gansert