Share This:

During testing of the latest updates available from Red Hat we noticed a change in behaviour that may have RHEL users scratching their heads (and not necessarily only ADDM users).


In 6.5, Red Hat have included numerous bug fixes in the coreutils package (8.4-31.el6) affecting the way the 'su' command handles session return values and exit status handling.


When running the ADDM upgrade processes, the process starts and stops various services. We noticed that after updating the OS packages the upgrade itself would be terminated when a service was stopped. Odd. The 3rd party service itself isn't a true service but rather a script that uses the services functions to manage starting and stopping of a daemon-like program - a legitimate use case.

The upgrade was starting the service which in turn ran a program as another user with the 'su' command. When a service stop was called the service script would use kill to stop the called program (who's parent session is now the upgrade's after the service start script run finished). The exit status would then trickle back to the upgrade process and terminate that too. Surprise!

This is an artefact of the Red Hat changes and the differences between 'su' and 'su -'. You'll find 'su username -c command' (no minus) executes a command as username but with (most of) the current environment while 'su - username -c command' (with minus) executes a command as a username but, according to the man page, "make the shell a login shell" - essentially a whole new session. Previously if you used 'su' (no minus) you could safely kill the sub-process but now, be warned, 'su -' is your friend.

We raised this with Red Hat because, in my opinion, the bug has been around long enough that fixing it is more like a change in behaviour. RH responded with the fact the new behaviour is expected but will raise a knowledge base article to add extra visibility. Details on the specific bug fixes can be found the RHEL 6.5 Technical Notes.