Currently, when /etc/rc.d/rc.local runs, it completely stomps the contents of the /etc/issue file. The comments in rc.local state: # This will overwrite /etc/issue at every boot. So, make any changes you # want to make to /etc/issue here or you will lose them when you reboot. This is a very inflexible way to deal with the /etc/issue file. There's also no convenient way to override what rc.local does (except by modifying it directly), as it runs *after* all of the other init scripts. I don't want to have to edit rc.local directly, as then I have to worry about integrating my changes with the next release of Red Hat. Attached is a patch for /etc/rc.d/rc.local that will allow more customization of the /etc/issue file. If the file /etc/issue.fixed exists, its contents will be used verbatim as the /etc/issue file. If /etc/issue.fixed does not exist, but /etc/issue.preamble exists, then /etc/issue.preamble will be prepended to the /etc/issue that rc.local normally creates.
Created attachment 1572 [details] patch for /etc/rc.d/rc.local
rc.local is %config(noreplace); any local changes will *never* be overriden. Therefore, I don't see the need for this as much.
Please reconsider, or at least consider an alternative. I didn't open this bug to complain that my changes to /etc/rc.d/rc.local would be overridden; I opened this bug to complain that the only avenue I have for customizing the login banner is by editing /etc/rc.d/rc.local in the first place. The reason I am reluctant to edit /etc/rc.d/rc.local is because it comes with Red Hat code already in it. If I edit this file, then for every single upgrade I perform from that point forward, I must check to make sure that Red Hat hasn't stuffed more things into this file, because I'll miss any changes (due to the fact that the file is %config(noreplace)) unless I specifically look for them. In fact, the reason you gave for closing this bug (that any local changes will *never* be overridden) I consider a bug, and not a feature. If Red Hat changes /etc/rc.d/rc.local, I'd *prefer* that my local changes are moved to /etc/rc.d/rc.local.rpmorig, because breaking my local changes will make me notice that Red Hat has made changes that I need to go integrate. IMO, if /etc/rc.d/rc.local is supposed to be a location for "your own initialization stuff" (as the comments say), then I think it is an error for Red Hat's building of /etc/issue to be placed there in the first place. Instead, the building of /etc/issue should take place in a separate SysV-style startup script (S99issue, probably, since S99local is a symlink to /etc/rc.d/rc.local), and the /etc/rc.d/rc.local that the initscripts package provides should contain comments only, without any actual code. I will provide patches for initscripts to implement this behavior (S99issue), if you will accept them.
rc.local is not going to have anything added to it in the forseeable future, for the reasons you mention. It might shrink at some point. Something like what you mention will probably be implemented at some point. If you'd like to attach a patch, we'll look at it.
Created attachment 3238 [details] /etc/rc.d/init.d/issue patch for initscripts-5.00-01
Ok, I've attached a simple patch to demonstrate what I think is the best course of action to take. This moves the building of /etc/issue entirely into a separate initscript, and leaves /etc/rc.d/rc.local with nothing in it but comments.
I like it, and I have done a similar thing for rc.sysinit in bug 23497. All this patch needs is a 'touch /var/lock/subsys/issue' to stop it running at random runlevel changes. A similar 'touch /var/lock/subsys/local' for bug 17279 could be done while your at it.
Changed in 6.01-1. /etc/issue isn't touched at all; it's a static file in another package that users are free to customize.