Created attachment 479481 [details] Patch agains Satellite 5.4 Description of problem: There is an hardcoded last action in the Satellite Kickstartformatter which will add changes to the /etc/motd. Resulting in Destroying the /etc/motd from Config channels. Version-Release number of selected component (if applicable): Doesn't work since Satellite 4.1 How reproducible: Steps to Reproduce: 1. generate an kickstart 2. attach an Activation key 3. put an own /etc/motd file in an Config channel, attachted to the activiation key 4. Install the Machine Actual results: The /etc/motd is not the /etc/motd from the Config channel, because of hard coded change of the /etc/motd in the Satellite Code Expected results: /etc/motd like this one in my config channel Additional info: I have created and tested an patch against Satellite-5.4 , it is removing the hrad coded /etc/motd changes. Customers who will have this changes, can include the lines to there Kickstart post.
Created attachment 479504 [details] Patch with Code removed from Sourcecode and added as an snipplet
The fist patch is removing the static code. The second patch is moving the static code to an snipplet.
Extracting the .tgz to see content: Proposed snippet 'append_motd' contents: echo >> /etc/motd echo "kickstarted on \\$(date +'%Y-%m-%d')\" >> /etc/motd echo >> /etc/motd Proposed diff to remove code and instead call snippet: --- a/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java 2011-02-18 10:51:45.000000000 +0100 +++ b/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java 2011-02-18 10:52:07.000000000 +0100 @@ -78,11 +78,6 @@ Config.get().getString("web.product_name") + " Config Management" + NEWLINE; private static final String COMMENT = "#" + NEWLINE; - private static final String MOTD_FOOTER = "# MOTD" + NEWLINE + "echo >> /etc/motd" + - NEWLINE + "echo \"" + Config.get().getString("web.product_name") + - " kickstart on \\$(date +'%Y-%m-%d')\" >> /etc/motd" + - NEWLINE + "echo >> /etc/motd" + NEWLINE + NEWLINE + - "# end of generated kickstart file"; private static final String BEGINRHN = "%post --logfile " + "/root/ks-rhn-post.log" + NEWLINE + "# --Begin " + Config.get().getString("web.product_name") + @@ -245,7 +240,7 @@ buf.append("%post"); //new %post for last kernel stuff addCobblerSnippet(buf, "post_install_kernel_options"); addCobblerSnippet(buf, "koan_environment"); - buf.append(MOTD_FOOTER); + addCobblerSnippet(buf, "append_motd"); buf.append(NEWLINE); buf.append("$kickstart_done"); buf.append(NEWLINE);
I've changed the proposed patch a bit and added missing stuff. Current behavior: - default_motd snippet will be automatically added to the kickstart and used if not overridden A user has a possibility to override motd: - by a post kickstart script - by deploying a configuration file drawback: /etc/motd doesn't contain product name any more Anyway, thank you for the patch! spacewalk.git: f47ed24770fe7e2d8dc5fd3393b6c7faddc269c9
We would be happy to see this patch reach production. As for the product name not being in /etc/motd, we're fine because it's still in /etc/issue.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: At the end of a kickstart /etc/motd was set without any possibility to override it. Result: Now custom /etc/motd content may be set either by a custom kickstart snippet or by deploying a configuration file.
Moving to Verified: Testing procedure: - formerly created kickstarts set motd as before - newly created kickstarts set motd w/out mentioning product - with newly created kickstarts, users are able to customize motd in a %post script - all free variants successfully kickstarts system Verified against: spacewalk-java-1.2.39-101
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1388.html
*** Bug 663771 has been marked as a duplicate of this bug. ***