I have tried looking around on Google and LQ for an answer to this question, but I can't seem to find the answer, and I'm hoping that someone here knows the answer. For reference I am running FC6 so if there is any distro specific stuff below, that is what I am using for a reference.
When I issue a "yum upgrade openssh" while connected to the machine via ssh, the sshd process is obviously running, but I don't get disconnected during the upgrade and yet it still seems to work. As I understand it, when rpm replaces an in use file, it renames the old file to a new name and/or location and then replaces the file and sends a HUP signal to the process.
However, if this is what happens, then I still have a few lingering questions about this process. When a process like sshd gets restarted with a HUP signal, it apparently doesn't completely shutdown because my ssh session doesn't close, and apparently the new process doesn't totally take over because I see the following entry in my /var/log/security after a "yum update openssh":
Sep 24 09:30:21 [hostname removed] sshd: Received signal 15; terminating.
Sep 24 09:30:22 [hostname removed] sshd: Server listening on :: port 22.
Sep 24 09:30:22 [hostname removed] sshd: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
From this it appears that the old sshd is still running and bound to port 22. So my two questions are:
(1) As I understand it the old sshd executable still exists somewhere and is running. What is the convention that rpm uses to rename/move in use files that are replaced, and what eventually happens to them? (i.e. how do I make sure that they get deleted/removed at some point in the future. Is this taken care of by one of the daily/weekly/monthly cron jobs)
(2) From the logs it appears that the new sshd process fails to start up properly (or at least fails to bind to port 22, and so isn't listening for new connections anywhere). Do I need to do anything to finish the transition? I have tried a "service sshd restart", but I get exactly the same log message. Do I have to reboot the machine to finish this update, or will it eventually resolve itself if I log out for a while?