The '.config' files in '/etc/init/' are overwritten on update of 'initscripts' package

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6

Issue

After upgrading to Red Hat Enterprise Linux 6.2 from 6.1, it was noticed that the custom changes that had been made to '/etc/init/control-alt-delete.conf', to prevent the reboot of the system by a key-press of 'ctrl-alt-del', were overwritten due to the 'initscripts' package being updated.

The Unix STIG, which is mandatory guidance for all DoD systems, requires that the 'ctrl-alt-del' reboot sequence be disabled for all systems not in a controlled access area. Prior to Red Hat Enterprise Linux 6, this functionality was disabled in '/etc/inittab'. With the change from 'SysVinit' to 'upstart' in Red Hat Enterprise Linux 6, it is now in '/etc/init/control-alt-delete.conf'.

The overwriting of the file on an update of the 'initscripts' package, means that the custom changes to this file must be re-deployed to each Red Hat Enterprise Linux 6 system, after every update to the 'initscripts' package.

Resolution

However, the way to achieve the objective of preserving the custom settings, is already available  upstream through the creation and use of  '/etc/init/control-alt-delete.override' file. If an override file is  present, the stanzas it contain, take precedence over those equivalently  named stanzas, in the corresponding configuration file contents for a  particular job. This was tracked by the internal bugzilla which is closed with the errata.

http://rhn.redhat.com/errata/RHBA-2012-0863.html

Root Cause

A look at the Bugzilla shows that the generally accepted view is, that  files in '/etc/init/' cannot be considered as configuration files. These  files contain descriptions of how the system is supposed to  boot/operate, and if they are not kept consistent with the packaging  system across updates, the system may cease to function. So these files  cannot be marked as '%config' files in the 'initscripts' rpm, and so are overwritten on every update of the package.

Diagnostic Steps

Notice that the '/etc/init/control-alt-delete.conf' file, as well as the other '.conf' files in the same location, are not included in the configuration file listing of the 'initscripts' rpm.

# rpm -qf /etc/init/control-alt-delete.conf 
initscripts-9.03.27-1.el6.x86_64

# rpm -qlc initscripts
/etc/X11/prefdm
/etc/adjtime
/etc/inittab
/etc/networks
/etc/rc.d/rc.local
/etc/rc.d/rc0.d/S00killall
/etc/rc.d/rc0.d/S01halt
/etc/rc.d/rc1.d/S99single
/etc/rc.d/rc2.d/S99local
/etc/rc.d/rc3.d/S99local
/etc/rc.d/rc4.d/S99local
/etc/rc.d/rc5.d/S99local
/etc/rc.d/rc6.d/S00killall
/etc/rc.d/rc6.d/S01reboot
/etc/sysconfig/init
/etc/sysconfig/netconsole
/etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/readonly-root
/etc/sysctl.conf

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.