chris
(Chris Dellaway)
4
If this is for anything other than testing/experimentation, you’re doing in wrong.
This is pretty standard for linux, the old binary is still in use and will exist until it is no longer ‘open’.
What can stop the running process is the upgrade scripts included in the package. You cannot assume that a package will or will not stop the current process. My opinion is you should always test it yourself too.
From unlink man page:
If the name was the last link to a file but any processes still
have the file open, the file will remain in existence until the
last file descriptor referring to it is closed.
Example. Running 4.0 and upgraded the binary to 4.2, the running inode and the new binary inode are different, also note that the replaced binary shows as (deleted).
ls -li /proc/$(pidof mongod)/exe; ls -li /usr/bin/mongod
28134638 lrwxrwxrwx 1 root root 0 Aug 23 08:05 /proc/4906/exe -> '/usr/bin/mongod (deleted)'
408225 -rwxr-xr-x 1 root root 73807784 Dec 19 2013 /usr/bin/mongod
Disclaimer: running as root for illustration purposes only, always run your mongod under a dedicated user.
1 Like